Opencart中的最低订单金额

时间:2013-04-09 17:53:20

标签: php opencart currency checkout

我使用Opencart 1.5.5.1,我遇到了问题。我想在我的商店最小订单金额。但我使用两种货币(EUR& RON)。好吧,我添加的脚本效果很好,但是当我从EUR切换到RON时,脚本不会改变。

EX。欧元订单最低为230,RON为1000。 当我订购约250E的产品时,消息不会出现。但我的结账必须以RON货币重定向。 ($这 - > currency->设置( 'RON');) 和消息apear。 “您必须订购> 1000 RON”,但从EUR到RON的转换等于或大于。

以下是我的理解代码:

<?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 个答案:

答案 0 :(得分:1)

试试这个......

<?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; ?>

使用少于因为没有空if语句而更容易阅读。

相关问题