Home Forums WoodMart support forum Mini cart subtotal / item price not updating correctly with B2B for WooCommerce

Mini cart subtotal / item price not updating correctly with B2B for WooCommerce

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #675806

    sx
    Participant

    Hi,
    I’m currently using the Woodmart theme together with the plugin B2B for WooCommerce. I’ve encountered an issue where the mini cart subtotal doesn’t reflect the correct pricing when a product is added to the cart — specifically when special B2B prices are applied based on user roles.

    I contacted the B2B plugin support, and they confirmed that:

    Their plugin uses WooCommerce’s default hooks to update cart prices.

    The issue seems to be caused by a conflict with how the subtotal is rendered / item price in the Woodmart mini cart.

    They asked me to contact you to check which hook Woodmart uses to display the subtotal in the mini cart / item price, since the default WooCommerce hooks appear not to be working with your theme.

    Could you please let me know:

    Which hook(s) does Woodmart use to update or render the mini cart subtotal / item price?

    Thanks in advance for your support!

    #675830

    Artem Temos
    Keymaster

    Hello,

    To better assist you, could you kindly test the functionality with default WordPress themes such as TwentyTwenty or WooCommerce Storefront? This will help us determine whether the issue stems from our theme or elsewhere.

    Also, send us your admin access so we can investigate this, too.

    Regards

    #675843

    sx
    Participant

    Hi,
    thank you for your reply.

    Yes, I already tested the functionality with other theme, and the mini data updates correctly there — so the issue appears only when using the Woodmart theme.

    I’ll send you the admin access in a private message and other info.

    Thanks for your support,

    #675999

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    add_action('init', function () {
    	if ( defined( 'AFB2B_PLUGIN_DIR' ) && wp_doing_ajax() && ! empty( $_POST['action'] ) && 'woodmart_ajax_add_to_cart' === $_POST['action'] ) {
    		include_once AFB2B_PLUGIN_DIR . 'additional_classes/class_afb2b_role_based_pricing_front.php';
    	}
    });
    #676017

    sx
    Participant

    Thanks, your fix seems to be working well!

    #676117

    Artem Temos
    Keymaster

    You are welcome. Feel free to contact us if you have any further questions.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Mini cart subtotal / item price not updating correctly with B2B for WooCommerce’ is closed to new replies.