WooCommerce cart total count minus certain product category
I have a client that sells boxes and units of a product – for the units they need to be sold in multiples of 6, for the boxes it doesn’t matter, so I need the cart total to be less the boxes total and checked to see if it is divisible by 6 – if…
Read MoreSet WooCommerce cart product count total to be divisible by number
You can set WooCommerce cart total product count to be divisible by a certain number, if it is not divisible by that number then do not allow the user to 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() {…
Read More