How to set a minimum purchase order amount

When a customer places an order, how to set a minimum order amount?

ie) The total order quantity is not less than 500 US dollars.

I know how to get the total amount of an order. But I do not know where to place this code and where to check

sOrderId = Mage::getSingleton('checkout/session')->getLastOrderId(); $oOrder = Mage::getModel('sales/order')->load($sOrderId); if($oOrder >=$500) { ..... } 

If a customer only bought less than $ 500, they will not be allowed to go to the basket.

+7
source share
2 answers

Log in as admin, then go to System-> Configuration , then select "Sales" on the left Nav and click on "Minimum Orders." Then select Yes from the "Include" drop-down list, enter the minimum order amount, enter a message and also enter an error message that will be displayed whenever the order is less than the specified amount in the shopping cart.

Thanks.

+15
source

You need to change the setting area of ​​the minimum amount. To do this, you need a new module with the system.xml file, which contains the same path to the minimum amount field and simply changes the value of <show_in_store> . Read more about it here .

0
source

Source: https://habr.com/ru/post/946922/


All Articles