• Resolved ashrafkotb

    (@ashrafkotb)


    Whenever the user removes an item from the cart, they are getting a dummy page that breaks the theme as can be seen here:

    https://ibb.co/GVPmNPX

    If the page is refreshed, they get the correct cart page.

    How to redirect the user to the default cart page without getting this message when removing an item from the cart?

    • This topic was modified 2 years, 11 months ago by ashrafkotb.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello @ashrafkotb!

    Can you please try the suggestions of this page and see if it solves the issue? → https://www.businessbloomer.com/woocommerce-solving-cart-empty-issue/

    Thread Starter ashrafkotb

    (@ashrafkotb)

    Thanks for your reply Mashi. The link is a guide to a different problem (the cart is not being updated).

    My issue is different. The cart gets updated when adding a product. However, when I try to remove a product from the cart, I get that dummy page in the screenshot above.

    I want to bypass this notice and get a refreshed version of the cart.

    The correct view I want to get after removing the item from the cart would look like this: https://ibb.co/QD3XF60

    • This reply was modified 2 years, 11 months ago by ashrafkotb.

    Hi @ashrafkotb

    Thanks for clarifying.

    Whenever the user removes an item from the cart, they are getting a dummy page that breaks the theme

    Can you please check if the solution provided on this StackOverflow thread work for you?
    https://stackoverflow.com/questions/55225439/getting-an-error-when-trying-to-remove-a-cart-item-from-the-woocommerce-checkout

    If it doesn’t help then in order to check your configuration and assist you further, could you please share the following:

    1. System Status: You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”. Once you’ve done that, paste it here in your response.
    2. Fatal Error Log: Share a copy of any fatal error log found under WooCommerce > System Status > Logs (if available).

    We’ll look forward to hearing from you.

    Thread Starter ashrafkotb

    (@ashrafkotb)

    I think this is a bit different from what I’m trying to achieve. I found something very close to what I want to achieve, but it seems it needs to be reviewed for the latest version. I tried to use it as is, but the notice still appears.

    function remove_added_to_cart_notice()
    {
    $notices = WC()->session->get('wc_notices', array());
    foreach( $notices['notice'] as $key => &$notice){
        if( strpos( $notice, 'whilst' ) !== false){ 
            $BadNotice_key = $key;
            unset( $notices['notice'][$BadNotice_key] );
            WC()->session->set('wc_notices', $notices);
            break;
        }
    }
        unset( $notices['notices'][$added_to_cart_key] );
    
        WC()->session->set('wc_notices', $notices);
    }
    add_action('woocommerce_before_single_product','remove_added_to_cart_notice',1);
    add_action('woocommerce_shortcode_before_product_cat_loop','remove_added_to_cart_notice',1);
    add_action('woocommerce_before_shop_loop','remove_added_to_cart_notice',1);

    Could you please check the above and let me know if it needs any changes?

    Mirko P.

    (@rainfallnixfig)

    Hi @ashrafkotb,

    Did you try hiding the notice with CSS? That said, please note that we do not provide support for customizations on this forum. You may want to share your website’s URL and I’ll leave this thread open for a bit to see if anyone is able to chime in to help you out.

    You can consult with customization experts listed at https://woocommerce.com/customizations/.

    You can also visit the WooCommerce Facebook Community group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers.

    Seems we’ve not had additional inputs on this thread. Thus, we encourage you to make use of the above resources.

    I’ll go ahead and mark the thread as resolved but please feel free to create a new thread if you have further questions.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Dummy page after removing item from cart’ is closed to new replies.