Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Magneto add to cart success message

the problem is client wants to fadeout the success message after few seconds by clicking add to cart button. I have made a change in addCartSuccessMessage.phtml file like this:

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var \Magento\Framework\View\Element\Template $block */
?>

<?= $block->escapeHtml(__(
    'You added %1 to your <a href="%2">shopping cart</a>.',
    $block->getData('product_name'),
    $block->getData('cart_url')
), ['a']);

?>
<script type="text/javascript">

    require(['jquery'], function($){
        $(".message.success").fadeOut(7000);

    });
</script>

Now the problem is if i open up the site on mobile the notification shows up only one time and after that no matter how many times i click on add to cart button success message wont show up it shows up again only if i refresh the page

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!