Okay
  Public Ticket #3572689
How can I display the quote order list when the customer has not registered an account but show order page
Closed

Comments

  •  3
    Hung started the conversation



    I really want that after pressing the Send Custom Quote Request button, a list of form field information and a list of order items will be displayed even when  the customer does not have an account.

    Tôi rất muốn sau khi ấn nút Send Custom Quote Request xong thì sẽ hiển thị danh sách thông tin fields form và danh sách mặt hàng order kể cả  khách hàng chưa có tài khoản.

    8476504500.png

    8924882465.png

    9130970016.png
  •  1,910
    WebWizards replied

    Hi there,

    At the moment the way this works is that the logged out user will receive an email with their quote request:

    5149252593.png


    If you want, you can also add it to a page, and redirect the customer to that page, like this:

    1. Create a new page like this:

    6891611098.png


    2. Add this code snippet to your site:

    add_filter('b2bking_quote_request_url_redirect', function($redirect){
        return 'quote-request-success';
    }, 10, 1);
    add_shortcode('b2bking_quote_success', function(){
        ob_start();
        echo 'Your quote request details:<br>';
        $msg = get_user_meta(get_current_user_id(), 'quotemsg', true);
        if (empty($msg)){
            if (isset($_COOKIE['quotemsg'])){
                $msg = $_COOKIE['quotemsg'];
            }
        }
        echo $msg;
        return ob_get_clean();
    });
    add_filter('b2bking_quote_cart_message_final', function($message){
        update_user_meta(get_current_user_id(), 'quotemsg', $message);
        setcookie('quotemsg', $message, time() + (86400 * 30), "/"); // 86400 = 1 day
        return $message;
    }, 10, 1);
    

    I took a video of how it works:

    https://www.loom.com/share/92068aec22064d029c00eded8703bb48?sid=7558b8a5-de6a-4a5d-9600-532e80c9545a


    The URL (slug of your page) must be 'quote-request-success'.

    Inside the page you must put the [b2bking_quote_success] shortcode, the same as in the image.

  •  3
    Hung replied

    Thank you very much.

  •   Hung replied privately
  •   WebWizards replied privately
  •   Hung replied privately
  •  1,910
    WebWizards replied

    Hi there,

    I tested now on your site as a logged out user and tried sending a quote.

    After doing this as a logged out user, I do see the following page:

    3926197813.png


    So it seems the details have still been saved / displayed.

    Do you need other changes to this or is it already working as needed?

  •  3
    Hung replied

    Thanh you very much