URL Parameter to Clear the Cart

8 months agocompleted1

When putting together bundles or products that go together (using the /?add-to-cart=73,82 url parameters), it would be very helpful to have a “clear the cart” options. For example /?clear_cart?add-to-cart=73,82.

Sample code… add_action( ‘init’, ‘woocommerce_clear_cart_url’ );
function woocommerce_clear_cart_url() {
if ( isset( $_GET[‘clear-cart’] ) ) {
global $woocommerce;

1 thought on “URL Parameter to Clear the Cart”

Leave a Reply

Scroll To Top

Get Help!

Submit your question and Spence will get back to you quickly via Email!