javascript - Woocommerce Clear Notices When Adding to Cart -
how can call php woocommerce function wc_clear_notices()
whenever url $product->add_to_cart_url()
called via ajax?
php
<?php echo '<div class="hs_cart vc_col-sm-2">' . '<button url="' . $product->add_to_cart_url() . '">add cart</button>' . '</div>'; ?>
javascript
<script> $('.hs_cart button').click(function(){ $.get($(this).attr('url')); }); </script>
Comments
Post a Comment