我想隐藏继续结帐按钮,直到购物车价格小于100,客户组是"零售商",如果价格大于100,客户组是"零售商",然后继续结帐按钮显示。如何实现这个功能?帮助我。
在您的主题中编辑模板文件
checkout/onepage/link.phtml
there is code
<?php if ($this->isPossibleOnepageCheckout()):?>
<button type="button" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
<?php endif?>
你会在
中找到这个函数isPossibleOnepageCheckout()
Mage/Checkout/Block/Onepage/Link.php
您可以扩展这个类并添加您可以隐藏checkout按钮的自定义逻辑。
也在/Mage/Checkout/controllers/OnepageController.php
in indexAction()
写你的条件,这样用户被重定向到购物车页面,如果条件不满足