dougua3706 2013-04-09 17:53
浏览 51

Opencart中的最低订单金额

I use Opencart 1.5.5.1 and I have a problem. I want in my store minimun order amount. But I am using two currencies (EUR & RON). Well, the scripts that I've added works great, but when I switch from EUR to RON the script doesn't change.

EX. Order min in EUR is 230 and in RON is 1000. When I order products about 250E the message doesn't appear. But my checkout must redirect in RON currency. ($this->currency->set('RON');) And the message apear. "You must order > 1000 RON" but conversion from EUR to RON is equal or bigger.

Here is my code to understand it:

<?php if($this->session->data['currency'] == 'EUR') : ?>
   <?php if($this->cart->getSubtotal() < 230) : ?>
   <div class="warning"><center><?php echo $text_comandamin_eur; ?></center></div>
   <?php endif; ?>
<?php } elseif($this->session->data['currency'] == 'RON') : ?>
   <?php if($this->cart->getSubtotal() < 1000) : ?>
   <div class="warning"><center><?php echo $text_comandamin_ron; ?></center></div>
   <?php endif; ?>
<?php endif; ?>
  • 写回答

1条回答 默认 最新

  • douluxia0606 2013-04-09 18:09
    关注

    Try this...

    <?php if($this->session->data['currency'] == 'EUR') : ?>
        <?php if($this->cart->getSubtotal() < 230) : ?>
        <div class="warning"><center><?php echo $text_comandamin_eur; ?></center></div>
        <?php endif; ?>
    <?php } elseif($this->session->data['currency'] == 'RON') : ?>
        <?php if($this->cart->getSubtotal() < 1000) : ?>
        <div class="warning"><center><?php echo $text_comandamin_ron; ?></center></div>
        <?php endif; ?>
    <?php endif; ?>
    

    It's easier to read using less than because you do not have an empty if statement.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大