Sort specific product category cart items at the end in WooCommerce
问题 How to sort items from a defined product category to be at the end of a cart order, for example I want all products that belong to a product category 'bottle' to be at the end of the cart order. I have found this code that sorts by price, but would like to adjust to as described above. add_action( 'woocommerce_cart_loaded_from_session', 'prefix_cart_order_prod_cat' ); function prefix_cart_order_prod_cat() { $products_in_cart = array(); // Assign each product's price to its cart item key (to