• Russell

    (@russelljamison)


    FYI, if you change the get_cart_item_addons_price_from_session function in class-wcj-product-addons.php to

    if ( array_key_exists( 'wcj_pa_total_extra_price', $item ) && ! array_key_exists( 'bundled_by', $item ) ) {
        $item['data']->set_price( $item['wcj_pa_total_extra_price'] );
    }
    return $item

    That’ll make your code compatible with the Yith Product Bundles plugin. The problem is that Yith adds a product for the overall bundle to the card, and it also adds each product within the bundle to the cart. The get_cart_item_addons_price_from_session function doesn’t recognize the difference between a standalone product vs one that is being included as a part of a bundle, and so each product that is a part of the bundle ends up getting added on top of the price of the bundle itself. It doesn’t matter if any addons are being added to the price or not for this problem to occur, just having the addon module turned on makes this behavior start to occur. By checking for the presence of the $item['bundled_by'] key you can know if a product is being included as a part of a bundle, ignore it if it is, and the cart total will then be correct.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Product Addons with the Yith bundling plugin’ is closed to new replies.