stephaNNb Posted October 28, 2013 Share Posted October 28, 2013 Hello. I got stuck on my project on my product page. I have 2 attributes colors and size, both gat title and can be selected. I need to display the title or the name of the color and the name of a size in a separate div. near my button add to cart. But i cannot find the right code to make this. Can somebody give me an advice? Or there is a plugin who can make my job easy ? Thank you. Link to comment Share on other sites More sharing options...
vekia Posted October 28, 2013 Share Posted October 28, 2013 by default prestashop displays attributes above the add to cart button. You want to move: - color attribute - size attribute near to the add to cart button? Or you want to display there something else? can you shed some light on this please? if you want to display only attribute name as a separate thing (not related to attributes selection), what if someone change attribute ? Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted October 28, 2013 Share Posted October 28, 2013 If you need to display the color or size attributes title according to user selections, then you can use simple inline JS onchange() function. e.g <select name="color" id="attr_color" onchange="$('#myCustomDiv').text($(this).val());"> {* options *} </select> {* create new html element/block to display the selected value. You should place this html element/block in appropriate location or you may use CSS. *} <div id="myCustomDiv"></div> 1 Link to comment Share on other sites More sharing options...
venom2506 Posted December 17, 2013 Share Posted December 17, 2013 (edited) If you need to display the color or size attributes title according to user selections, then you can use simple inline JS onchange() function. e.g <select name="color" id="attr_color" onchange="$('#myCustomDiv').text($(this).val());"> {* options *} </select> {* create new html element/block to display the selected value. You should place this html element/block in appropriate location or you may use CSS. *} <div id="myCustomDiv"></div> Hello, sorry to bump this topic, but could you provide a code example for the display element, and what to put in {* options *}? Thank you in advance; Edited December 17, 2013 by venom2506 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 17, 2013 Share Posted December 17, 2013 {* options *} it's a comment, it will not appear, so you don't have to use it Link to comment Share on other sites More sharing options...
venom2506 Posted December 17, 2013 Share Posted December 17, 2013 Thank you. Mmh, I think I misunderstood what this did, I expected a summary of the selected attributes, but I get a rolldown menu. I guess I will open a new topic to ask how to do the summary. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now