bartwind Posted June 25, 2020 Posted June 25, 2020 Im importing products with images: if (count($d->images)) { foreach ($d->images as $img) { $url = $img->url; $cover = boolval($img->cover); $position = intval($img->position); $image = new Image(); $image->id_product = $pid; $image->position = $position; $image->legend = $img->legend; $image->cover = $cover; if (($image->validateFields(false, true)) === true && ($image->validateFieldsLang(false, true)) === true && $image->add()) { $image->associateTo(1); if (!AdminImportController::copyImg($pid, $image->id, $url, 'products', true)) { $image->delete(); } } } } else { file_put_contents('no_images.txt',$d->name." \n", FILE_APPEND); } but images not showing on page. On admin backend(products edit page) images exists and showing but on page frontend they not display. I have to open manually edit product and click Save to "refresh" images and make it possible to load display on page. How to do it in php code? Is there any way to refresh all images in prostashop products or refresh in php code images for product id? I tried Refresh all thumbnails in Improve-> Design Imges setting and it still not working. Thx for help! Share this post Link to post Share on other sites More sharing options...
bartwind Posted June 26, 2020 Posted June 26, 2020 (edited) thumbnails images are generated in folder but not indexed by product until i will manually open and click Save... Prestashop..... 😐 Edited June 26, 2020 by bartwind (see edit history) Share this post Link to post Share on other sites More sharing options...
Guest Posted June 28, 2020 Posted June 28, 2020 FORCE recompile template and clear cache. Settings -> Performance Share this post Link to post Share on other sites More sharing options...
bartwind Posted June 28, 2020 Posted June 28, 2020 Thanks for answer but it not fixed problem. Share this post Link to post Share on other sites More sharing options...
Guest Posted June 28, 2020 Posted June 28, 2020 Are there thumbnails of FTP images in the .img/p/x folders? You need to give more information. Share this post Link to post Share on other sites More sharing options...
bartwind Posted June 28, 2020 Posted June 28, 2020 (edited) i think only study Images controller or Products after save can help or http bot Edited July 6, 2020 by bartwind (see edit history) Share this post Link to post Share on other sites More sharing options...
bartwind Posted July 16, 2020 Posted July 16, 2020 Prestashop team😐👎 I had to make bot http because of you made image indexing in PS wrong way Share this post Link to post Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now