PHP:Magento 如何显示可配置产品的选项(例如网格)代替默认下拉列表
我想更改可配置产品选项的默认行为。默认情况下,它在下拉框中显示选项;我想在网格上显示它而不是下拉菜单。
I want to change the default behavior of the configurable products option. By default it shows options in a dropdown box; I want to show that on a grid in place of the dropdown.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
创建新的产品选择器是一项相当艰巨的任务。我无法告诉你如何将其变成网格,因为你必须处理多个选择等。但我可以告诉你的是,你将花费大量时间的文件是:
/app/design/frontend/基本/默认/模板/目录/产品/视图/options.phtml
Creating a new product selector is a pretty big undertaking. I cannot tell you how to turn it into a grid because you have to handle multiple selections, etc. But what I can tell you is that the file you are going to spend a lot of time in is:
/app/design/frontend/base/default/template/catalog/product/view/options.phtml
我也做过类似的事情。
您将面临的主要问题是使其与magento javascript 组件一起工作,这样您仍然可以使用Magento 提供的所有功能。
由于这几乎不可能不被破坏,因此我使用了一个脚本,该脚本在选择框上放置了一个自己的 html 控件。
https://github.com/claviska/jQuery-SelectBox
这个主要是为了自定义设计一个DropDown 框,但您可以“滥用”它来具有任意结构,因为您有常用的 html 元素,您可以使用 CSS 放置您想要的位置。
I have done something similar.
The main Problem you will face is to make it work with the magento javascript components, so you can still use all functions which are provided by Magento.
As this is nearly impossible not to breake, i used a script, which places an own html control over the selectbox.
https://github.com/claviska/jQuery-SelectBox
This is mainly for customice Design of a DropDown box, but you can "misuse" it to have arbitary structures, as you have usual html elements you can place how you wish with CSS.
您可以尝试使用一个插件,例如 Magento Mechanics 的这个插件,它将为您完成所有艰苦的工作:
http://www.magemechanics.com/product-grid-options.html
我已经使用并推荐了那里的插件。
You could try looking at using a plugin such as this one by Magento Mechanics which will do all the hard work for you:
http://www.magemechanics.com/product-grid-options.html
I have used and recommend there plugin.