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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -