[英]Magento - How to add extra button like “Add to cart” and Redirect to external url from grid view, list view and product page view.
I want to add extra button like "Add to cart" for example "Live Demo". 我想添加诸如“添加到购物车”之类的额外按钮,例如“实时演示”。 Then, as their are no of products each one have unique demo link that I will add from "Manage attributes" section of admin. 然后,由于它们都不是产品,所以每个人都有一个独特的演示链接,我将从admin的“管理属性”部分添加该链接。 I want to redirect "Live Demo" button to that particular product page demo url and after their should be also a button at header section for "Buy now". 我想将“实时演示”按钮重定向到该特定产品页面的演示URL,在它们之后也应该是“立即购买”标题部分的按钮。
Currently I have added a extra button in product page. 目前,我在产品页面中添加了一个额外的按钮。
How can I do this on grid view and list view. 如何在网格视图和列表视图上执行此操作。
By making changes in /var/www/magentodemo/app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml 通过在/var/www/magentodemo/app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml中进行更改
<button type="button" title="<?php echo $Demo ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $Demo ?></span></span></button>
But which class name and onclick function I should call for this button to redirect to external url (to call external url attribute.) 但是我应该调用哪个类名和onclick函数来将该按钮重定向到外部url(以调用外部url属性。)
Anyone have done this before. 以前有人做过。 please let me know your thoughts. 请让我知道你的想法。
Thanks in advance. 提前致谢。
First of of you need to make your new attribute used in 首先,您需要在
product listing under manage attributes 管理属性下的产品列表
and after that you can make use of this new attribute in grid pages in list.phtml file of your current theme by calling that new attribute as other you can see in your file like name etc. 然后,您可以调用当前主题的list.phtml文件中的网格页面中的新属性,方法是将该新属性调用为其他新属性,例如名称等。
thanks and let me know if you have any issues 谢谢,让我知道你是否有任何问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.