• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Checkout
  • Cart
  • Videos

Only Allow Woo Products From Any Category To Be Added To Cart Once Item from Specific Category Added 1st

$75.00

Demo Video
Category: WooCommerce Tags: has_parent_term, remove_cart_item, woocommerce_add_to_cart
  • Description

These 2 code snippets force your customers to add at least 1 item from a specific category before items from other categories can be added to the cart. If no items from your allowed category are added first, then items from other categories cannot be added.

Is Purchasable On Specific Date

Additionally, the 2nd code snippet also enables you to add a specific date so your customers are forced on this specific date to purchase at least 1 product from a specific category before they can buy products from other categories. On all other dates, they can purchase products from any categories without restrictions.

Installation

Copy & paste 1 of the 2 code snippets to the end of your child themes functions file or custom functionality plugin.

Swap out the allowed-category slug with the category slug for your specific category.

If using the date specific code, swap out the date as well so the code only runs on a specific date.

Primary Sidebar

Cart

Code written by Brad Dalton specialist for WooCommerce with more than 10 years of experience.

Advertise · WPEngine · Genesis · Log in

  • Code Snippets
  • Tutorials
  • Videos
  • Account
  • Checkout
  • Cart
 

Loading Comments...
 

You must be logged in to post a comment.