1

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

4

2 回答 2

3

可悲的是,我一直想知道为什么这还没有在配置中。您有两个选择,您可以扩展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.') ?>

于 2012-09-21T10:09:31.627 回答
1

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

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

便宜又有效

感谢之前的回答/提示

于 2014-01-04T16:46:02.187 回答