V1.7 Product image CDN updater module prestashop

Marciano

Well-known member
Elite
XNullUser
Joined
Apr 14, 2021
Messages
32
Reaction score
385
Points
53
NullCash
201
This module can update image to CDN, your server only need one origin image. no need resize other small image.
we1.png
1、Modify src/Adapter/Product/ProductDataProvider.php
Find function name public function getImage($id_image)

Change:

`'base_image_url' => _THEME_PROD_DIR_ . $imageData->getImgPath(),`
to:

'base_image_url' => '//' . \Configuration::get('ETCLOUDIMAGE_ACCOUNT_DOMAIN') . '/v7/' . $imageData->getImgPath() . '.jpg?w=98&h=98p=',

img
we2.png
2、Modify src/Adapter/Image/ImageRetriever.php
Find function name public function getImage($object, $id_image)

Remove

$resizedImagePath = implode(DIRECTORY_SEPARATOR, [
$imageFolderPath,

$id_image . '-' . $image_type['name'] . '.' . $ext,
]);
if (!file_exists($resizedImagePath)) {
ImageManager::resize(
$mainImagePath,
$resizedImagePath,
(int) $image_type['width'],
(int) $image_type['height']
);
}
img
we3.png

3、Add Origin prefix
img

we4.png
4、Add image type
we5.png

5、Delete small image
 

Attachments

  • image-CDN-updater.zip
    1.4 MB · Views: 4

d-shilko

Well-known member
Pro
Master
Diamond
Elite
Joined
Jun 10, 2021
Messages
2,490
Reaction score
1,408
Points
113
NullCash
6,262
Can you provide link of module page, and version?!
 

bebarpos

Member
XNullUser
Joined
Apr 3, 2021
Messages
265
Reaction score
16
Points
18
NullCash
2
free module...
 

pk2res

Active member
XNullUser
Joined
Sep 23, 2020
Messages
1,308
Reaction score
5
Points
38
NullCash
5
Thank you very much !
 

Sillumin

Well-known member
Pro
Master
Diamond
Elite
Joined
Jun 18, 2021
Messages
3,620
Reaction score
743
Points
113
NullCash
5,953
Thank you very much! It can be useful module!
 
Top