How to Force Only One Product Per Order in Magento 2

A Magento 2 store owner may want to limit the number of items to be purchased per order due to limited stock or some selling strategy. This may even be the case when production conditions come to picture. It might not be feasible for the store owner to deliver a number of items at a time for a single order due to higher production cost.

Moreover, according to a marketing strategy, it is good to reach to more people rather than selling products in large quantity to a smaller crowd. When there is a limited stock, admin decides to sell one product per order to market it among more potential customers.

The condition to Force Only One Product Per Order in Magento 2 has to be configured programmatically as the default Magento 2 does not provide this option.

I’ll give the steps to implement the condition to Force Only One Product Per Order in Magento 2.

Steps to Force Only One Product Per Order in Magento 2:

Step 1: Create event.xml file at etc directory

Step 2: Create Cartadd.php file at Observer directory

That’s all you need to do to Force Only One Product Per Order in Magento 2!

Any doubts on the topic are welcome in the Comments section.
Rate the post with 5 stars if you liked it.

Happy Coding 🙂

5
(based on 9 Reviews)
How to Force Only One Product Per Order in Magento 2Author Magento Badge

Sanjay Jethva

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. Owing to his contributions in Magento Forums and posting solutions, he is among the top 50 contributors of the Magento community in 2019. When he is not engrossed with anything related to Magento, he loves to play cricket.

2 Comments

Leave a Reply

Your email address will not be published.