Home Forums WoodMart support forum “Product has been added to your cart” message doesn’t disappear

“Product has been added to your cart” message doesn’t disappear

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #627371

    Jimson
    Participant

    When a visitor adds a product to the cart, they are redirected to the cart page.

    If I’m not mistaken, in the past, the “Product has been added to your cart” message appeared at the bottom of the page and disappeared after a short time. However, now the message remains displayed on the cart page.

    I would like the message to disappear automatically after 3 seconds once the user is redirected to the cart. How can I achieve this?

    #627664

    Hello,

    I have checked your site and did not see any “Product has been added to your cart” message at the bottom of the cart page. If you can provide a screenshot or more details, I’d be happy to assist further in reproducing and resolving the issue.

    Best Regards

    #627680

    Jimson
    Participant

    I didn’t say that the “Product has been added to your cart” message is at the bottom of the cart page—I mentioned that it used to be in previous team versions. Currently, it appears above the cart content (see the screenshot in the private section).

    The main issue is that the message remains displayed on the cart page after adding a product. I wouldn’t expect this to be normal behavior for a label. At the very least, users should be able to dismiss it, but ideally, it should disappear automatically after a few seconds.

    While waiting for your initial response, I created a script that achieves this. However, your theme should have built-in controls for this, or you should be able to tell me the default behavior of the label.

    PS: Please include your screenshots in the private content.
    PPS: Now, the “On Sale” and “Out of Stock” labels have suddenly disappeared from the products. Did you change anything?

    `function custom_hide_woocommerce_notice() {
    if (is_cart()) { // Ensure the script only loads on the Cart page
    wp_add_inline_script(‘jquery’, ”
    document.addEventListener(‘DOMContentLoaded’, function () {
    setTimeout(function () {
    let noticeMessage = document.querySelector(‘.woocommerce-notices-wrapper .woocommerce-message’);
    if (noticeMessage) {
    noticeMessage.style.opacity = ‘0’;
    noticeMessage.style.transition = ‘opacity 0.5s ease-out’;
    setTimeout(() => {
    noticeMessage.remove();
    }, 500); // Ensures smooth removal after fade-out
    }
    }, 3000); // 3 seconds delay before hiding
    });
    “);
    }
    }
    add_action(‘wp_enqueue_scripts’, ‘custom_hide_woocommerce_notice’);

    #627782

    Jimson
    Participant

    Here is a screenshot of an earlier version of your theme, where notifications appeared below the screen and could be closed by the user. However, in the current version, notifications remain fixed on the page. I hope this makes it clear what the issue is with these notifications.

    Attachments:
    You must be logged in to view attached files.
    #627937

    Hello,

    01. These notifications are coming from woocommerce. Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?

    02. I have not made any changes to your site. Upon reviewing your site, I can confirm that the “Sold Out” label is displaying correctly on the product “Epicea Bark 20-40.”

    Best Regards

    #628022

    Jimson
    Participant

    Since your theme does not customize the user experience for these notifications, you may close this ticket. I will find another solution.

Viewing 6 posts - 1 through 6 (of 6 total)