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.