Jump to content

I need help with product images in a module PS 1.7


costin_yo

Recommended Posts

Hello, I have an API module that takes the images from the product and sends them to another website. The problem is that the other website recently changed their images from square to landscape and all my products has square images and I do not want to change.

I checked the API module and I want to create another image set in prestashop (like cart_default, home_default etc.) to be the size that the other website needs. 

This module has the following code to get the images from products:

 $product_images = array();
        $link = new Link();
        $imagelinks = array();
        $images = $product_data->getImages($id_lang);
        foreach ($images as $image) {
            $p_images = array();
            $p_images['url'] =  Tools::getShopProtocol() . $link->getImageLink(
                $product_data->link_rewrite,
                $id_product . '-' . $image['id_image']
            );
            $product_images[] = $p_images;
        }

        $product_return["images"] = $product_images;

 

Please let me know what do I need to change to this code to get a specified image category set already created. For example I want to get all images from products with  "cart_default"  size.

Thank you very much and I hope someone will answer before the other website changes his layout again.

 

 

 

 

Edited by costin_yo (see edit history)
Link to comment
Share on other sites

  • 2 years later...

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