Magento自定义选项-在自定义选项字段中添加CSS className [英] Magento Custom Options - add a CSS className to the custom option field
问题描述
我想指定一个CSS类以应用于我的自定义选项字段.这将使我能够在产品视图页面上使用更强大的JavaScript选择器.
I want to specify a CSS class to apply to my custom options fields. This will allow me to use more robust JavaScript selectors on the product view page.
因此在Admin的Product> Custom选项中,我想要这样的内容:
So in Product>Custom options in the Admin I want to have something like this:
我在其中将CSS Class属性添加到该字段的位置.
Where I've added the CSS Class attribute to the field.
可以在adminhtml模板文件中添加足够的内容:
This can be added simply enough in the adminhtml template file:
app\design\adminhtml\default\default\template\catalog\product\edit\options\option.phtml
但是我不知道我需要覆盖/扩展哪些文件才能在单击保存"时使其保存该额外属性. 谁能指出我正确的方向?
But I don't know which files I need to override/extend in order to get it saving that extra attribute when I click Save. Can anyone point me in the right direction?
推荐答案
假定您对选项类型文本"执行此操作.您需要提供一种输入,编辑,存储和输出此新属性的方法.
Assuming you do this for the option type "text". You need to provide a way to enter, edit, store, and output this new property.
要输入:如您所知,您必须编辑后端模板文件. app \ design \ adminhtml \ default \ default \ template \ catalog \ product \ edit \ options \ type \ text.phtml:
To Enter: As you have already found out, you must edit the backend template files. app\design\adminhtml\default\default\template\catalog\product\edit\options\type\text.phtml: