function 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','force_individual_cart_items', 10, 2 ); /* * @desc Remove quantity selector in all product type */ function remove_all_quantity_fields( $return, $product ) { return true; } add_filter( 'woocommerce_is_sold_individually', 'remove_all_quantity_fields', 10, 2 );