Skip to content

Instantly share code, notes, and snippets.

@BurlesonBrad
Created December 7, 2015 22:19
Show Gist options
  • Select an option

  • Save BurlesonBrad/fc0fdbeb58c057c49f58 to your computer and use it in GitHub Desktop.

Select an option

Save BurlesonBrad/fc0fdbeb58c057c49f58 to your computer and use it in GitHub Desktop.
for Louise
add_filter( 'woocommerce_add_cart_item_data', 'rodolpho_is_a_sexy_beast_empty_cart', 10, 3);
function rodolpho_is_a_sexy_beast_empty_cart( $cart_item_data, $product_id, $variation_id )
{
global $woocommerce;
if ( $product_id == 851 ) {
$woocommerce->cart->empty_cart();
}
return $cart_item_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment