简体   繁体   English

Magento-如何添加诸如“添加到购物车”之类的额外按钮,以及如何从网格视图,列表视图和产品页面视图重定向到外部URL。

[英]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.

相关问题 Magento 2 - 如何在“添加到购物车”按钮下方的产品视图页面上显示自定义添加的属性? - Magento 2 - How to show custom added attributes on product view page below "add to cart" Button? 如何将属性值添加到magento网格或列出产品视图 - How to add an attribute value to magento grid or list product view Magento:将多个“添加到购物车”按钮和数量字段添加到产品查看页面 - Magento: Add multiple add to cart buttons and qty fields to product view page Magento-在产品查看页面中从购物车中移除产品的选项 - Magento - Option to Remove product from cart within product view page magento 1.9将产品添加到购物车时无法通过外部网址运行 - magento 1.9 add product to cart not working from an external URL 将“添加到购物车”按钮重定向到Magento中的其他自定义页面/在Magento的产品页面中添加新按钮 - Redirect “Add To Cart” Button to different custom page In Magento / Add new Button in Product Page in Magento 如何更改“添加到购物车”按钮以查看“产品列表”部分中的按钮 - how to change add to cart button to view button in list of products section 将添加到购物车按钮文本 + url 更改为“我的帐户”当客户之前购买了产品时的订单查看页面 - Change add to cart button text + url to My account Order view page when customer has previously bought the product "将 Woocommerce 的“添加到购物车”按钮更改为“查看产品”按钮" - Changing Woocommerce "Add to cart" button to "view product" button 如何在 WooCommerce 中的“添加到购物车”按钮旁边添加查看产品详细信息按钮链接? - How to add View Product Detail Button Link Beside “Add To Cart” Button In WooCommerce?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM