Set WooCommerce cart product count total to be divisible by number

Number Of Products Woocommerce

…checkout. add_action( ‘woocommerce_check_cart_items’, ‘check_cart_items_conditionally’ ); /** * Check cart items conditionally displaying an error notice and avoiding checkout * @link https://stackoverflow.com/questions/65767078/disable-woocommerce-checkout-if-cart-items-count-is-not-a-multiple-of-n */ function check_cart_items_conditionally() { $multiple_of = 6; // <=…

Read More

Sort WooCommerce products from product category to be last in cart order

Woocommerce Cart Product Category Last

…WC()->cart->cart_contents = array_merge( $other_items, $items_in_category ); } Above example uses ‘box’ as a product category, to re-arrange the order swap the arrays in array_merge. WC()->cart->cart_contents = array_merge( $items_in_category, $other_items );…

Read More