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

…to be last order in cart * @link https://stackoverflow.com/questions/65800801/sort-specific-product-category-cart-items-at-the-end-in-woocommerce */ function product_category_cart_items_sorted_end() { $category_terms = __(‘box’); // Here set your category terms (can be names, slugs or Ids) $items_in_category =…

Read More

Add Modern Tribe Event Categories as CSS classes in Event Posts

Modern Tribe Event Category

…in. add_filter( ‘body_class’, ‘cp_event_taxonomy_in_body_class’ ); // Ref – https://theeventscalendar.com/support/forums/topic/add-category-name-as-body_class/ // Add event categories terms to body class of event posts function cp_event_taxonomy_in_body_class( $classes ){ global $wp_query; $event_id = $wp_query->get_queried_object_id(); if…

Read More