In some cases, we would like to have product in WooCommerce added in the cart as separate items and not as the same item with the changed quantity. You can do that with pasting the code below in the functions.php
.
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 );