nc715 Posted February 9, 2013 Share Posted February 9, 2013 Anyone knows how to display the colors of a product on the product list pages? Link to comment Share on other sites More sharing options...
NemoPS Posted February 10, 2013 Share Posted February 10, 2013 (edited) Hi, That would be a bit complex i believe. As far as I know, Prestashop doesn't assign all attributes in the products list page, bt only the id of the default one, so that it can be picked and added to the cart. Therefore, you'd need to: 1- edit or extend the categorycontroller controller, and once the product are retrieved, foreach of them fetch all the attributes (or use a custome function and get colors only) 2- copy the code from the product page in the attributes section (only where it displays colors), and adjust it from an object type to an array type. 3- add additional js code if you want the image to be swapped. In this case you'll need to edit this HEAVILY, really, since you won't have additional images in that list, either.. To sum up, you have to be very of of php/js and prestashop's architecture in general to do it. If you are, you can follow those hints anyway Fabio Edited February 10, 2013 by Nemo1 (see edit history) Link to comment Share on other sites More sharing options...
editorstefan Posted April 23, 2013 Share Posted April 23, 2013 (edited) Hi, That would be a bit complex i believe. As far as I know, Prestashop doesn't assign all attributes in the products list page, bt only the id of the default one, so that it can be picked and added to the cart. Therefore, you'd need to: 1- edit or extend the categorycontroller controller, and once the product are retrieved, foreach of them fetch all the attributes (or use a custome function and get colors only) 2- copy the code from the product page in the attributes section (only where it displays colors), and adjust it from an object type to an array type. 3- add additional js code if you want the image to be swapped. In this case you'll need to edit this HEAVILY, really, since you won't have additional images in that list, either.. To sum up, you have to be very of of php/js and prestashop's architecture in general to do it. If you are, you can follow those hints anyway Fabio Thanks Fabio Alot people want this so would be really nice if you could help us with some javascript to change image when you choose color! This may work for you, but not for me :'( http://www.prestashop.com/forums/topic/81210-colors-on-product-listtpl/page__st__80__p__1196421?do=findComment&comment=1196399 Edited April 23, 2013 by editorstefan (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