woocommerce product addon - empty cart upon going to product page
<p>Right now I am trying to get it so that whenever someone gets to my site's product page their cart is automatically emptied.</p>

<p>I am using a woocommerce product addon called "Product &amp; Checkout Options for WooCommerce" that allows me to use radiobuttons/checkboxes for my products, I don't know if that will alter any of the code.</p>

<p>I've tried php code such as this but it hasn't worked:</p>

<pre><code>add_filter( 'woocommerce_add_to_cart_validation', 'only_one_in_cart' , 10, 1);

function only_one_in_cart( $cart_item_data ) {
   global $woocommerce;
   $woocommerce-&gt;cart-&gt;empty_cart();
   unset($cart_item_data['product_meta']);
   return true;
}
</code></pre>