Magento继续购物网址更改

时间:2012-09-21 05:42:27

标签: magento

magento后端是否有任何设置可以更改继续购物网址?如果有任何设置,请告诉我如何更改。我正在使用Magento 1.7.x

2 个答案:

答案 0 :(得分:2)

可悲的是,我一直想知道为什么这不在配置中。您有两种选择,您可以扩展Mage_Checkout_Block_Cart以应用逻辑来确定要使用的URL,或者您可以在模板中设置URL。

<?php $this->setContinueShoppingUrl('http://URL.com'); ?>

<div class="page-title">
    <h1><?php echo $this->__('Shopping Cart is Empty') ?></h1>
</div>
<div class="cart-empty">
    <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
    <p><?php echo $this->__('You have no items in your shopping cart.') ?></p>
    <p><?php echo $this->__('Click <a href="%s">here</a> to continue shopping.', $this->getContinueShoppingUrl()) ?></p>
</div>

但是,如果您要在模板中进行设置,也可以将更改<?php echo $this->__('Click <a href="%s">here</a> to continue shopping.', $this->getContinueShoppingUrl()) ?>移至<?php echo $this->__('Click <a href="http://URL.COM">here</a> to continue shopping.') ?>

答案 1 :(得分:1)

要在“NOT”空购物车中更改继续购物按钮的重定向网址,只需添加第二个代码行,然后在asterix **中突出显示... your_theme / default / checkout / cart.phtml:

<?php if($this->getContinueShoppingUrl()): ?>
**<?php $this->setContinueShoppingUrl('http://yoursite.com/...'); ?>**
    <button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
                        <?php endif; ?>
便宜&amp;有效

感谢之前的回答/提示