如何隐藏继续结帐按钮,直到购物车价格低于100且客户群不是零售商的magento?

时间:2014-08-22 17:09:32

标签: magento

我想隐藏继续结帐按钮,直到购物车价格低于100且客户群为“零售商”,如果价格大于100且客户群为“零售商”,则继续结帐按钮显示。如何实现这一功能?帮我。

1 个答案:

答案 0 :(得分:0)

在您的主题中,编辑模板文件

  

checkout/onepage/link.phtml

有代码

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

您可以扩展此类并添加自定义逻辑,您可以通过该逻辑隐藏结帐按钮。

同样在/Mage/Checkout/controllers/OnepageController.php

indexAction()

中的

编写您的条件,以便在未满足条件时将用户重定向到购物车页面