0

我使用 Opencart 1.5.5.1,但我遇到了问题。我想要在我的商店中的最低订单量。但我使用两种货币(欧元和罗朗)。好吧,我添加的脚本效果很好,但是当我从 EUR 切换到 RON 时,脚本并没有改变。

前任。欧元的最低订购量为 230,RON 为 1000。当我订购 250E 左右的产品时,该消息不会出现。但我的结帐必须以 RON 货币重定向。($this->currency->set('RON');) 消息出现。“您必须订购 > 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; ?>
4

1 回答 1

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

使用 less 更容易阅读,因为您没有空的 if 语句。

于 2013-04-09T18:09:36.097 回答