Thursday, July 4, 2019

How to set minimum order value in opencart?

If you want to set minimum cart order total before anyone can make the checkout.



Please follow the below instructions.

Step 1 : Please open the file path catalog/controller/checkout/checkout.php

Step 2 :  Add this line in your checkout.php controller file.

// To set a mimimum shopping cart value of $1000
if ($this->cart->getSubtotal() > 1000){
$this->session->data['error'] = 'Please note: there is a minimum shopping cart value of 1000 before shipping and tax for you to proceed to checkout.';
$this->response->redirect($this->url->link('checkout/cart'));
}
   
After the below code

if ((!$this->cart->hasProducts() && empty($this->session->data['vouchers'])) || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) {
     $this->response->redirect($this->url->link('checkout/cart'));
}


Thats it.

No comments:

Post a Comment

Popular Posts