Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Don't group products at cart – Woocommerce
<?php
add_filter('woocommerce_add_cart_item_data', 'namespace_force_individual_cart_items', 10, 2);
function namespace_force_individual_cart_items($cart_item_data, $product_id) {
$unique_cart_item_key = md5(microtime() . rand());
$cart_item_data['unique_key'] = $unique_cart_item_key;
return $cart_item_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment