Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save encoderit-arman/8b52931c92ac4eb4c24931fb756a7b64 to your computer and use it in GitHub Desktop.
Save encoderit-arman/8b52931c92ac4eb4c24931fb756a7b64 to your computer and use it in GitHub Desktop.
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;
}
add_filter( 'woocommerce_add_cart_item_data', 'namespace_force_individual_cart_items', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment