Woocommerce: How to add minimum amount for different categories with different amount per category with different notice.

// Display notice on single product page for specific category add_action('woocommerce_before_single_product_summary', 'display_category_notice'); function display_category_notice() { global $product; $categories = get_categories_with_minimum_amount(); $cart_items = WC()->cart->get_cart(); $notices = array(); foreach ($categories as $category_name => $minimum_amount) { if (has_term($category_name, 'product_cat', $product->get_id(), false)) { $category_total = 0; foreach ($cart_items as $cart_item) { if (has_term($category_name, 'product_cat', $cart_item['product_id'], false)) { $category_total += […]

Login To Access Code Snippet:

Stay UpTo Date with Latest Post And news: