Jump to content

Colors on product-list.tpl (Prestashop 1.5)


Recommended Posts

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 by Nemo1 (see edit history)
Link to comment
Share on other sites

  • 2 months later...

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 by editorstefan (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...