• Resolved Paul

    (@paulschiretz)


    Hi there,

    The integration for WPC Product Bundles is broken again.

    It seems the woosb_id is now saved as array by WPC instead of a string.
    Your integration outputs:

    <input name="woosb_ids" class="woosb_ids woosb-ids" type="hidden" value="Array">

    in the woocommerce loop with the function: tinvwl_woo_product_bundle_loop_data. When i then click the heart button, on the products archive the bundle is added to the wishlist but i get a nasty error when i try to add it to the cart from the wishlist page.

    Besides that, i get a php error/warning on every page call cause the Array for value is outputted like this:

    PHP Warning:  Array to string conversion in /var/www/.../wp-includes/formatting.php on line 1104

    To reproduce the issue, simply install a WPC product bundles version > 7.0.0 create a bundle and try to click the heartbutton on the products archive page.

    Would be really nice if you could look into that! If you need some more debugging i can help you with that as well!

    All the best,
    Paul

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Paul

    (@paulschiretz)

    Ok, did some more debugging, this seems to fix the issue(basically building the string like WPC does for the add to cart button). For now i simply replace your function by unhooking the action and adding my own.

    remove_action( 'tinvwl_wishlist_addtowishlist_button', 'tinvwl_woo_product_bundle_loop_data', 10, 2 );
    
    add_action( 'tinvwl_wishlist_addtowishlist_button', 'custom_tinvwl_woo_product_bundle_loop_data', 10, 2 );
    	function custom_tinvwl_woo_product_bundle_loop_data( $product, $loop ) {
    
    		if ( $loop && 'woosb' === $product->get_type() ) {
    			$ids_str = '';
    			if ( get_post_meta( $product->get_id(), 'woosb_ids', true ) ) {
    				$ids = get_post_meta( $product->get_id(), 'woosb_ids', true );
    				if ( is_array( $ids ) ) {
    					foreach ( $ids as $item ) {
    						if ( ! empty( $item['id'] ) ) {
    							$ids_arr[] = $item['id'] . '/' . $item['qty'];
    						}
    					}
    					$ids_str = implode( ',', $ids_arr );
    				} else {
    					$ids_str = $ids;
    				}
    			}
    			
    			$ids_str = ( version_compare( WOOSB_VERSION, '6.2.0', '<' ) ) ? WPCleverWoosb_Helper::woosb_clean_ids( $ids_str ) : WPCleverWoosb_Helper::clean_ids( $ids_str );
    			?>
    			<input name="woosb_ids" class="woosb_ids woosb-ids" type="hidden"
    				   value="<?php echo esc_attr( $ids_str ); ?>"/>
    			<?php
    		}
    	}

    Would be great to have that fixed in an upcoming version!

    All the best,
    Paul

    Plugin Author templateinvaders

    (@templateinvaders)

    Hi @paulschiretz

    The issue has been fixed in version 2.8.0. Feel free to update our plugin to the latest version.

    Thread Starter Paul

    (@paulschiretz)

    Hi @templateinvaders,

    Feels really good to hear from you!(read the statement in your support box) Thanks for the update!!

    All the best, to you!

    Greets from austria,

    Paul

    • This reply was modified 1 year ago by Paul.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Again the WPC Bundles Integration is broken’ is closed to new replies.