# 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.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, cart, quantity
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-sold-individually/

## Code

```php
add_filter( 'woocommerce_is_sold_individually', '__return_true' );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Limit Every Product to One per Order" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
