Skip to content

Instantly share code, notes, and snippets.

@kloon
Last active September 13, 2024 22:41
Show Gist options
  • Select an option

  • Save kloon/4541017 to your computer and use it in GitHub Desktop.

Select an option

Save kloon/4541017 to your computer and use it in GitHub Desktop.

Revisions

  1. kloon renamed this gist Jan 15, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. kloon revised this gist Jan 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    // check for clear-cart get param to clear the cart, append ?clear-cart to any site url to trigger this
    add_action( 'init', 'woocommerce_clear_cart_url' );
    function woocommerce_clear_cart_url() {
    21if ( isset( $_GET['clear-cart'] ) ) {
    if ( isset( $_GET['clear-cart'] ) ) {
    global $woocommerce;
    $woocommerce->cart->empty_cart();
    }
  3. kloon created this gist Jan 15, 2013.
    8 changes: 8 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    // check for clear-cart get param to clear the cart, append ?clear-cart to any site url to trigger this
    add_action( 'init', 'woocommerce_clear_cart_url' );
    function woocommerce_clear_cart_url() {
    21if ( isset( $_GET['clear-cart'] ) ) {
    global $woocommerce;
    $woocommerce->cart->empty_cart();
    }
    }