我是Magento的新手,我正在學習它。 我想在Magento產品詳細信息頁面的「添加到購物車」按鈕附近添加一個按鈕「Add to Wishlist」。 我如何做到這一點,使選定的產品將被添加到心願單。請致電 謝謝。如何在Magento的產品詳細信息頁面上添加「添加至願望清單」按鈕
0
A
回答
3
此功能已經存在於Magento中。
如果你想通過代碼來檢查這個功能比檢查了這一點 -
<div class="add-to-box">
<?php echo $this->getChildHtml('addto') ?>
</div>
此代碼可以在[主題] /template/catelog/product/view.phtml找到。
此代碼會導致調用「添加到收藏」按鈕,在商品詳細頁,這個按鈕來自[主題] /template/catelog/product/view/addto.phtml。
從這裏你可以管理這個按鈕。
您還可以啓用或通過管理部分禁用此功能 -
要控制添加到收藏鏈接的顯示:
- 從管理控制檯中,選擇System>組態。
- 在左側的配置面板中的客戶下,選擇願望清單選項卡。
單擊以展開常規選項部分,執行下列操作之一:
啓用設置爲Yes以顯示添加到收藏鏈接類別頁面和產品頁面。
將啓用設置爲否可從類別頁面和產品頁面中刪除添加到心願列表鏈接。
希望能對大家有所幫助。
謝謝!
0
我會寫這個作爲評論Anx的答案,但我沒有50聲望(有趣的系統,當然評論比答案更微不足道?),所以我增加了另一個答案。
如果您在遵循Anx的建議後仍然遇到麻煩,那麼您可能會遇到與我一樣的奇怪情況 - core_config_data表中沒有配置設置「wishlist/general/active」的條目。儘管它在管理面板中被標記爲活動。要解決這個問題,我只需進入系統>配置>心願單,然後單擊「保存配置」而不更改任何內容。 Presto中,條目出現在core_config_data(以及「wishlist/email/email_template」,「wishlist/email/email_identity」和「wishlist/wishlist_link/use_qty」)中。
1
使用「添加到收藏」按鈕
<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>
3
簡約歸到:...目錄/產品/view/addto.phtml然後:
<a href="<?php echo $this->
helper('wishlist')->getAddUrl($_product) ?>">
<?php echo $this->__('Add to Wishlist') ?></a>
相關問題
- 1. Magento 2追加到意願清單返回到產品詳細信息頁面
- 2. Magento:在產品詳細信息頁面添加Pinterest「Pin it」按鈕
- 3. Magento:在自定義尺寸的產品詳細信息頁面上添加textboxx
- 4. 在產品詳細信息頁面中添加自定義Metabox(Woo-commerce產品詳細信息頁面)
- 5. Magento:如何顯示產品已添加到願望清單的次數?
- 6. 在產品詳細頁面添加JS代碼magento
- 7. 在magento的產品頁面添加附加信息
- 8. Opencart - 將「添加到願望清單」添加到類別頁面
- 9. 如何在結帳頁面添加產品製造商詳細信息oscommerce
- 10. 產品詳細信息頁面上的Magento模塊
- 11. Virtuemart 1.1產品詳細信息頁面
- 12. Shopify,在產品頁面添加另一列用於發貨詳細信息
- 13. 產品詳細信息頁面未顯示在magento
- 14. 如何在magento管理端添加新產品添加頁面?
- 15. Prestashop:在產品清單/產品頁面上添加單個產品屬性
- 16. 更改magento中的產品詳細信息頁面?
- 17. Magento的產品詳細信息頁面顯示404錯誤
- 18. 如何在magento的產品頁面上添加自定義buynow按鈕
- 19. Magento產品詳細信息頁面未在搜索結果後加載
- 20. 在magento主頁上添加產品清單並帶說明
- 21. Magento sql查詢產品詳細信息
- 22. 如何將自定義產品附件添加到wordpress(woocommerce)中的產品詳細信息頁面?
- 23. Magento - 產品詳細信息頁面上不含稅,但包含在清單頁面
- 24. 如何在產品詳細信息頁面上輸入購物車的產品清單
- 25. 從Magento產品詳細信息頁面中刪除「價格」
- 26. magento每個產品詳細信息頁面顯示404
- 27. WooCommerce產品類別存檔,添加其他詳細信息
- 28. 如何爲Fullcalendar添加EventSource詳細信息頁面
- 29. 在magento API中添加商品至心願單
- 30. 如何編輯產品的詳細信息頁面的html在Magento adminhtml