Skip to content

Instantly share code, notes, and snippets.

@vishalck
Created August 2, 2017 20:42
Show Gist options
  • Save vishalck/542a34ff32a8d976dbff6927d994436f to your computer and use it in GitHub Desktop.
Save vishalck/542a34ff32a8d976dbff6927d994436f to your computer and use it in GitHub Desktop.
Initiate WooCommerce Empty Cart Action
<?php
public function woo_empty_cart_action() {
global $woocommerce;
if ( isset( $_REQUEST[ 'emptycart' ] ) && $_REQUEST[ 'emptycart' ] == 'yes' ) {
$woocommerce->cart->empty_cart();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment