Opencart minimum order price

后端 未结 2 604
不知归路
不知归路 2021-01-07 07:24

I am trying to implement below code from here in catalogue/view/theme/default/template/checkout/confirm.tpl

cart->getSubtotal() >         


        
相关标签:
2条回答
  • 2021-01-07 07:37

    The code below is working for me:

        <?php if($this->session->data['currency'] == 'USD') : ?>
           <?php if($this->cart->getSubtotal() < 2enter code here0) : ?>
           <div class="warning"><center><?php echo $text_comandamin_eur; ?></center></div>
           <?php endif; ?>
        <?php } elseif($this->session->data['currency'] == 'INR') : ?>
           <?php if($this->cart->getSubtotal() < 1000) : ?>
           <div class="warning"><center><?php echo $text_comandamin_ron; ?></center></div>
           <?php endif; ?>
        <?php endif; ?>
    
    0 讨论(0)
  • 2021-01-07 07:38

    Not the same way but you can do it like this:

    Add this line in your checkout.php controller file.

    if ($this->cart->getSubtotal() < 1000) {
        $this->session->data['error'] = 'Your warning message';
        $this->response->redirect($this->url->link('checkout/cart'));
    }
    

    After

    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.

    0 讨论(0)
提交回复
热议问题