我正在使用这段代码将愿望 list 添加到我的产品 View
<a onclick="setLocation('<?php echo $this->getAddToWishlistUrl($_product) ?>')"
class="buttons-wish" title="<?php echo $this->__('Add to Wishlist') ?>"></a>
<a onclick="setLocation('<?php echo $this->getAddToCompareUrl($_product) ?>')"
class="buttons-compare" title="<?php echo $this->__('Add to Compare') ?>"></a>
但由于某种原因它不起作用。
我需要帮助来解决问题
最佳答案
试试这个。
<a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
<a href="<?php echo $this->helper('catalog/product_compare')->getAddUrl($_product) ?>"><?php echo $this->__('Add to Compare') ?></a>
关于php - Magento 添加到愿望 list 代码不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21172562/