开发者

How can I echo attribute name On-Click or hover in Magento product view page

I installed a module that gave me color swatches as a thumbn开发者_如何学编程ail instead of dropdown. How can I echo the attribute (color) name once a user has clicked on the color?

For example, if they click the Black thumbnail, I would like the phrase "Color:Black" to display below. Can anyone help?

Thank you very much.


If your color swatches have a "selected" state, you may trivially be able to use that for styling. For instance:

<a class='color' href='#'><img src='path/to/red.png' /><span class='label'>Red</span></a>
<a class='color' href='#'><img src='path/to/green.png' /><span class='label'>Green</span></a>
<a class='color selected' href='#'><img src='path/to/blue.png' /><span class='label'>Blue</span></a>

And accompanying CSS:

.color .label { display:none; }
.color.selected .label { display:block; }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜