Limit Every Product to One per Order
Allows only one of each product in the cart, as if "Sold individually" were ticked on every product. Useful for licenses, courses and bookings.
Opens WPIDE on
Code
add_filter( 'woocommerce_is_sold_individually', '__return_true' );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.