• Resolved Steven Cooper

    (@kingcooper)


    Hi

    On my page I have cart JSON in top right corner of header.

    it drops a popover windows of cart contents, and checkout button.

    However when it’s empty it has a continue shopping button.

    I want to direct this button to a custom page, not */shop.

    Could you please direct me on what code to add to customs for this?

    Thanks

    Steve

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @kingcooper,

    Thanks for reaching out!

    To change the “Continue Shopping” button link when the cart is empty, you can add the following snippet to your theme’s functions.php file or a custom plugin:

    add_filter( 'woocommerce_return_to_shop_redirect', 'custom_empty_cart_redirect_url' );
    function custom_empty_cart_redirect_url() {
    return home_url( '/your-custom-page/' ); // Replace with your desired page slug or URL
    }

    Be sure to replace ‘/your-custom-page/’ with the correct slug or URL of the page you’d like to redirect users to.

    That said, this kind of customization is outside our official support scope, so you’ll need to use the code at your own responsibility. If you’re not comfortable making code changes, you might want to consult a developer to ensure it’s implemented safely.

    Thread Starter Steven Cooper

    (@kingcooper)

    Thanks @mahfuzurwp.

    Will try soon.

    Thread Starter Steven Cooper

    (@kingcooper)

    Yes, it works perfectly now.

    Thank you

    Hi @kingcooper,

    Glad to hear it’s working perfectly — thanks for the update! 🙌

    If you have a moment, we’d really appreciate it if you could leave a review here: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/#new-post. Your feedback helps us keep improving.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Cart json icon’ is closed to new replies.