<p>There is no existing config option for this behaviour with Commerce Pro.</p>
<p>You'd need to write a relatively simple custom module to do this.</p>
<p>You'd probably listen to something like this event:</p>
<p><a href="https://craftcms.com/docs/commerce/3.x/events.html#beforeaddlineitemtoorder" rel="nofollow noreferrer">https://craftcms.com/docs/commerce/3.x/events.html#beforeaddlineitemtoorder</a></p>
<p>...and remove anything else in the cart before the new item is added.</p>
<p>or, thinking about it, you might want to first make sure the new item has been successfully added, and only then remove the other items from the cart, in which case:</p>
<p><a href="https://craftcms.com/docs/commerce/3.x/events.html#afteraddlineitemtoorder" rel="nofollow noreferrer">https://craftcms.com/docs/commerce/3.x/events.html#afteraddlineitemtoorder</a></p>

CC BY-SA 4.0
2020-11-19T07:18:18.633Z
2020-11-19T07:18:18.633Z
Jeremy Daalder
<p>Is there a config option or something that would enable the 1 line item limit in cart. That means once customer adds second line item to cart first one would be removed so that only one would be left. I believe that's how Commerce Lite works. I need similar functionality on Pro licence.</p>

<plugin-craftcommerce3>
Enable single line item mode on Commerce Pro
# Enable single line item mode on Commerce Pro

(Asked by: username_0 on 2020-11-18)

Is there a config option or something that would enable the 1 line item limit in cart. That means once customer adds second line item to cart first one would be removed so that only one would be left. I believe that's how Commerce Lite works. I need similar functionality on Pro licence.

**Tags:** plugin-craftcommerce3


---

## 1 answers

### Answer by username_1 on 2020-11-19. Score: 2 | Accepted answer

There is no existing config option for this behaviour with Commerce Pro.

You'd need to write a relatively simple custom module to do this.

You'd probably listen to something like this event:

<https://craftcms.com/docs/commerce/3.x/events.html#beforeaddlineitemtoorder>

...and remove anything else in the cart before the new item is added.

or, thinking about it, you might want to first make sure the new item has been successfully added, and only then remove the other items from the cart, in which case:

<https://craftcms.com/docs/commerce/3.x/events.html#afteraddlineitemtoorder>


---

