如何加上「;添加到愿望列表“中”;Magento中产品详细信息页面上的按钮
我对Magento是新手,我正在学习。 我想在Magento产品详细信息页面的“添加到购物车”按钮旁边添加一个按钮“添加到愿望列表”。 如何将所选产品添加到愿望列表中 请帮忙如何加上「;添加到愿望列表“中”;Magento中产品详细信息页面上的按钮,magento,Magento,我对Magento是新手,我正在学习。 我想在Magento产品详细信息页面的“添加到购物车”按钮旁边添加一个按钮“添加到愿望列表”。 如何将所选产品添加到愿望列表中 请帮忙 谢谢。此功能已存在于Magento中 如果您想通过代码检查此功能,请检查此功能- <div class="add-to-box"> <?php echo $this->getChildHtml('addto') ?> </div> 您可以在[Theme]/templat
谢谢。此功能已存在于Magento中 如果您想通过代码检查此功能,请检查此功能-
<div class="add-to-box">
<?php echo $this->getChildHtml('addto') ?>
</div>
您可以在[Theme]/template/catelog/product/view.phtml中找到此代码。
此代码导致调用产品详细信息页面中的“添加到愿望列表”按钮,此按钮来自[Theme]/template/catelog/Product/view/addto.phtml.
从这里您可以管理此按钮
您还可以通过管理部分启用或禁用此功能- 要控制“添加到愿望列表”链接的显示,请执行以下操作:
- 将“启用”设置为“是”,以在类别页面和产品页面上显示“添加到愿望列表”链接
- 将Enabled设置为No可从类别页面和产品页面删除添加到愿望列表链接
希望这会有帮助
谢谢 我本想将此作为对Anx答案的评论,但我还没有50%的声誉(有趣的系统,评论肯定比答案更琐碎?),所以我添加了另一个答案
如果您在遵循Anx的建议后仍然有问题,那么可能您遇到了与我相同的奇怪情况-在core_config_数据表中没有配置设置“wishlist/general/active”的条目。即使它在管理面板中被标记为活动。为了修复它,我只需进入系统>配置>愿望列表并单击“保存配置”,而不做任何更改。首先,条目出现在核心配置数据中(以及“wishlist/email/email\u模板”、“wishlist/email/email\u标识”和“wishlist/wishlist\u链接/使用数量”)。对“添加到wishlist”按钮使用以下代码
<a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>"
class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
为“添加到购物车”按钮使用以下代码
<button type="button" title="<?php echo $this->__('Add to Cart') ?>"
class="button btn-cart"
onclick="setLocation('<?php echo $this->helper('checkout/cart')->getAddUrl($_product) ?>')">
<span>
<span><?php echo $this->__('Add to Cart') ?></span>
</span>
</button>
简单转到:…catalog/product/view/addto.phtml,然后:
<a href="<?php echo $this->
helper('wishlist')->getAddUrl($_product) ?>">
<?php echo $this->__('Add to Wishlist') ?></a>
你能回答这个问题吗?不为我工作。你能回答这个问题吗?