Jump to content

alternate image size in categories


carlitus

Recommended Posts

Hello,
 
We want to change the design as prestashop template show the images in the web and its categories, what we want is that instead they are always the same all go alternating by lines, that is
 
A line with 2 products one with large image and the other with normal image size
 
Next line with 3 products, all 3 with equal images
 
and so on,
 
Use prestashop 1.7.1.2
Any idea how I can do it?
 
Thank you.

Link to comment
Share on other sites

yes not sound complicated, I know php but I'm not expert in prestashop and I don't know what are the steps to do.

what I want to explain is something like the attach image  http://laanet.com/Capturamoda2017-07-14.png   . one line with 3 products where one of them has a photo more big than normals ans other line normal with 4 products....and then alternate this. 

 

I have 2 doubts  one is I can make a loop but how I know if a product has big photo or normal home photo?  and second is what I have to do, modify only productlist.tpl inside my template?

 

thanks for all

Link to comment
Share on other sites

The easiest is to temporarily switch off the pretty urls. Then you will see the product pictures as something like 

www.shop.com/img/p/6/6/6/666-medium_default.jpg.

 

If you look in that img/p/6/6/6 directory you will see all the formats available. In the image settings in your backoffice you can in which formats the image will be generated.

Link to comment
Share on other sites

  • 2 weeks later...

hi,

yes, but what we need is some products width a size and others with normal sizes, to do this finally I decided to add a chackbox property to an image product, like cover property,

I know this is not the right way to do but..... I found where are cover property and add my new chekbox in src/prestashopbundle/resources/views/admin/productimage/form.html.twig  and in src/prestashopbundle/controller/admin/productimagecontroller.php  I modified these files directly because I don't know how to add backoffice field without modify core files, there is some correct process to do this?

 

now checkbox appears in my backoffice but it don't save it to database, how can I do to save it?

 

thanks

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...