Okay
  Public Ticket #3821936
Offer and cart
Open

Comments

  •  2
    hurtowniadachow started the conversation

    How to do it in the b2b king pro plugin so that after activating the offer and sending an individual inquiry, the products do not disappear from the cart but remain in it?

  •  2,320
    WebWizards replied

    Hi there,

    If I understand correctly, you would like it so that when a customer sends a quote request, the cart is not emptied?

    It should be possible to achieve this by adding the following PHP code snippet to the site:

    add_filter('b2bking_empty_cart_on_quote_request','__return_false');

     

    This can be added to functions.php or to any snippets plugin.

     

    Kind regards,

    Stefan

  •  2
    hurtowniadachow replied

    Unfortunately, the php function does not work, the basket still empties automatically after sending the query. I tried entering other codes and unfortunately none of them work. 

    -------------------------------

    function custom_prevent_empty_cart_on_quote_request($cart) {
        if (is_user_logged_in()) {
            return;
        }

        if (isset($_GET['action']) && $_GET['action'] == 'b2bking_quote_request') {
            return;
        }
    }

    add_action('woocommerce_cart_updated', 'custom_prevent_empty_cart_on_quote_request');

    --------------------------------

    add_filter('b2bking_quote_request_empty_cart', '__return_false');

    --------------------------------

    add_action('woocommerce_before_cart', 'prevent_cart_empty_on_quote_request', 10, 0);
    function prevent_cart_empty_on_quote_request() {
        if (isset($_GET['action']) && $_GET['action'] == 'b2bking_quote_request') {

            remove_action('woocommerce_cart_updated', 'woocommerce_cart_updated', 10);
        }
    }


    What's more, the conversation feature doesn't work properly, replies to custom offers don't work or reach customers, and the "Conversations" tab on the "my account" page doesn't work. Should I create a new page with some shortcode specifically for this purpose?