title: Show popup after add-to-cart in all browsers
body: <p>I have a WooCommerce webshop where I would like to have a popup appear when people click on &quot;Add to cart&quot;.</p>
  <p>I have written some code as seen below and it also works as it should. The problem is that it only works in Google Chrome, and not e.g. Safari.</p>
  <p>I'm sure the problem is because of the page reloads when you click add to cart in Safari, but how can I fix it?</p>
  <p><strong>header.php</strong></p>
  <pre><code>        if (!wp_is_mobile()) {
              echo '&lt;div class=&quot;additional-popup&quot;&gt;';
              echo '&lt;div class=&quot;popup-top&quot;&gt;';
                  echo '&lt;h3&gt;Added to cart &lt;i class=&quot;far fa-check-circle&quot;&gt;&lt;/i&gt;&lt;/h3&gt;';
                  echo '&lt;div class=&quot;additional-btns&quot;&gt;';
                      echo '&lt;span class=&quot;additional-btn continue&quot;&gt;Continue shopping&lt;/span&gt;';
                      echo '&lt;a href=&quot;&quot; class=&quot;additional-btn go-cart&quot;&gt;Go to cart&lt;/a&gt;';
                  echo '&lt;/div&gt;';
              echo '&lt;/div&gt;';
              echo '&lt;div class=&quot;popup-bottom&quot;&gt;';
                  echo '&lt;h4&gt;Others saw too ...&lt;/h4&gt;';
                  echo do_shortcode('[products limit=&quot;3&quot; columns=&quot;3&quot; orderby=&quot;rand&quot;]');
              echo '&lt;/div&gt;';
          echo '&lt;/div&gt;';
          }
      
  </code></pre>
  <p><strong>additional-sales.js</strong></p>
  <pre><code>$(document).ready(function(){
  
    $( &quot;.single_add_to_cart_button&quot; ).click(function() {
      $( &quot;.additional-popup&quot; ).addClass( &quot;show&quot; );
      $( &quot;body&quot; ).addClass( &quot;stocked&quot; );
    });
  
    $( &quot;.continue&quot; ).click(function() {
      $( &quot;.additional-popup&quot; ).removeClass( &quot;show&quot; );
      $( &quot;body&quot; ).removeClass( &quot;stocked&quot; );
    });
  
  });
  
      
  </code></pre>