设置最低购物车$值-OpenCart v2.0



我已经看到了一个一年的线程(并且在错误的地方回复 - 对不起)OpenCart最低订单价格

我有opencart v2.0-我查看了目录 Controller Checkout checkout.php,并在页面顶部附近插入了代码(根据下面的片段)。这确实停止了结帐过程 - 但是当我的总数超过$ 25时,警告仍在显示并仍停止结帐过程中的下一步。我不确定下一步是正确的,即使应该在另一个结帐文件中?

您对此的帮助表示感谢。

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'));
}
/* new code to set a mimimum shopping cart value of NZD $25.00
if ($this->cart->getSubtotal() < 2500){
    $this->session->data['error'] = 'Please note: there is a minimum shopping cart value of $25.00 before shipping and tax for you to proceed to checkout.';
     $this->response->redirect($this->url->link('checkout/cart'));
}
*/
    // Validate minimum quantity requirements.
    $products = $this->cart->getProducts();

谢谢。

替换此行:

if ($this->cart->getSubtotal() < 2500)

to:

if ($this->cart->getSubtotal() < 25)

最新更新