2012-09-21 35 views
1

在magento後端有任何設置可以改變繼續購物網址嗎?如果有任何設置,請告訴我如何改變。我正在使用Magento 1.7.xMagento繼續購物網址更改

+0

繼續購物後什麼?查看? –

+0

是在購物車頁面和結帳頁面使用繼續購物網址。例如$ this-> getContinueShoppingUrl() –

回答

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.') ?>

+0

話雖如此,將該字段添加到配置中並不會太困難。 –

1

要改變繼續購物按鈕的重定向URL在「NOT」空購物車只需添加第二個代碼行下面突出顯示與星號**在... your_theme /默認/結帳/ 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; ?> 

便宜&有效

感謝上一個回答/提示