Okay
  Public Ticket #3415278
Update Cart button triggers new Purchase List
Closed

Comments

  •  4
    Mike Henderson started the conversation

    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

    Attached files:  Screenshot 2023-07-14 at 12.37.20 PM.png
      Screenshot 2023-07-14 at 12.33.45 PM.png

  •  2,218
    WebWizards replied

    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,

  •  2
    Matthew replied

    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,218
    WebWizards replied

    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://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/


    (the issue seems to be a theme conflict)

  •  4
    Mike Henderson replied

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