mrbinarydigit Posted January 11, 2012 Share Posted January 11, 2012 I looking for a free module or payment module that to be able show the description text when i change the attribute on my product. It is possible? Can make it with a little personalization of source code avec js or ajax? Pardon my english. Help me thanks. Link to comment Share on other sites More sharing options...
mrbinarydigit Posted January 12, 2012 Author Share Posted January 12, 2012 Is a good idea to use an innerhtml? What is the file where i have to add my code? Thanks. Link to comment Share on other sites More sharing options...
puecher Posted January 14, 2012 Share Posted January 14, 2012 If you won´t change db structure, you can work with jQuery. Edit product.tpl, add a <script> section where you put an attribute onchange function. Use the description field to add different descriptions for example [attr_0]Default text[/attr_0][attr_14]Description text for color = black[/attr_14][attr_15]Description text for disk space = 16Go[/attr_15] The attribute onchange function parses all descriptions and shows only the description text for specific attribute. Link to comment Share on other sites More sharing options...
mrbinarydigit Posted January 15, 2012 Author Share Posted January 15, 2012 thanks puecher, can you help me? I have not idea to make it. Thank you very much...I'm reading what is jQuery for understand your reply Link to comment Share on other sites More sharing options...
ecentury Posted September 13, 2017 Share Posted September 13, 2017 (edited) You could use the hide / show use of css, by adding div elements directly into your product description like this <div class="attribute1">This is the description for attribute 1</div><div class="attribute2">This is the description for attribute 2</div> and then find out the value of the attribute and add some javascript like this $('.attribute_fieldset.quality select').on('change',function(){ if ($('.attribute_fieldset.quality select').val() == 59) { $('.attribute1').css({'display':'block'}); $('.attribute2').css({'display':'none'}); } else if ($('.attribute_fieldset.quality select').val() == 58) { $('.attribute1').css({'display':'none'}); $('.attribute2').css({'display':'block'}); } }); That will then only show the description of 1 attribute Regards David Edited September 13, 2017 by ecentury (see edit history) 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