Public Ticket #3415278

Update Cart button triggers new Purchase List

Closed
Comments
7 Tickets 4
Mike Henderson started the conversation 3 years ago on July 14, 2023 at 6:47pm

In the cart, when changing quantities and updating cart the new purchase list dialog is triggered. When I cancel the new purchase list, the cart is then updated.

We are using a code snippet + shortcode to show the purchase list button on our cart page. See attachments

2,762
KingsPlugins replied 3 years ago on July 15, 2023 at 11:06am

Hi Mike,

The purchase list dialog should only be triggered when the class .b2bking_add_cart_to_purchase_list_button is clicked.

I am not sure how that is possible when the update cart button is clicked. I think either there is some kind of CSS conflict (e.g. the button containers are on top of each other somehow), or there is some kind of JS conflict with another plugin.

If you'd like to share backend access to the staging site with us, I can check this directly and troubleshoot,

7 Tickets 2
Matthew replied 3 years ago on July 22, 2023 at 11:03am

Has this issue been resolved? I have the same problem. The "Update Cart" Button is triggering a Purchase List and subsequently sends through a Custom Quote Request.

8801033778.png


2,762
KingsPlugins replied 3 years ago on July 22, 2023 at 8:24pm

Hi Matthew,

To solve that, please try adding this PHP code snippet to your site:

add_action('plugins_loaded', function(){
    add_action('wp', function(){
        global $b2bking_public;
        remove_action( 'woocommerce_cart_actions', array($b2bking_public, 'b2bking_purchase_list_cart_button'));
        add_action( 'woocommerce_after_cart_totals', array($b2bking_public, 'b2bking_purchase_list_cart_button'), 5000);
    });
});

A PHP snippet can be added to functions.php, or by following our guide here: https://b2bkingplugin.com/docs/how-to-add-a-snippet-php-or-js/

(the issue seems to be a theme conflict)

7 Tickets 4
Mike Henderson replied 3 years ago on July 24, 2023 at 2:48pm

All is working well for us now. The new snippet below plus Woocommmerce and theme updates have resolved the issue.

1

Sign In