aquaanimation Posted March 1, 2017 Share Posted March 1, 2017 Hello I have the following problem. The Related products on the back end after SAVE are not showing correct the images. The image path that its trying to search for them is https://www.domain.com/28-home_default/.jpg or something similar. Can you help me on how to fix this or tell me why this does happen? Best Regards, a.g. Link to comment Share on other sites More sharing options...
aquaanimation Posted March 7, 2017 Author Share Posted March 7, 2017 Any ideas on how I may be able to solve this without messing with the CORE? Link to comment Share on other sites More sharing options...
rocky Posted March 8, 2017 Share Posted March 8, 2017 The related product images are working fine on my PrestaShop v1.7.1.0 Beta test site. I see URLs like http://localhost/prestashop17/7-home_default/blouse.jpg What are the broken URLs you're getting? Link to comment Share on other sites More sharing options...
Vilius PromoApranga Posted March 8, 2017 Share Posted March 8, 2017 You can try to rebuild images Link to comment Share on other sites More sharing options...
aquaanimation Posted March 8, 2017 Author Share Posted March 8, 2017 You can try to rebuild images I have rebuilt the images with no luck... Link to comment Share on other sites More sharing options...
aquaanimation Posted March 8, 2017 Author Share Posted March 8, 2017 (edited) The related product images are working fine on my PrestaShop v1.7.1.0 Beta test site. I see URLs like http://localhost/prestashop17/7-home_default/blouse.jpg What are the broken URLs you're getting? The urls I am seeing on the inspector are like this https://www.mydomain.com/28-home_default/.jpg Do you think from the stable 1.7.0.5 I should update to the beta?? If you think that you can help I can PM you credentials. It is still in development stages. Edited March 8, 2017 by aquaanimation (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted March 9, 2017 Share Posted March 9, 2017 No, it's better to try to fix the cause. From the URL you've given, it seems the friendly URL is missing for the product. Make sure the friendly URL is filled in on the SEO tab. If you're unable to save it, try manually editing the ps_product_lang table in the database and setting the link_rewrite field for the product. Link to comment Share on other sites More sharing options...
aquaanimation Posted March 9, 2017 Author Share Posted March 9, 2017 The SEO friendly url is already filled but the image is not displayed. I have tried to alter the SEO friendly url and save but nothing happens. Any other suggestions? Link to comment Share on other sites More sharing options...
rocky Posted March 9, 2017 Share Posted March 9, 2017 I don't understand why it's working fine on my test site, but not your site. Perhaps you have an override causing the wrong links to be generated? You can check if override/class/Link.php exists. Otherwise, you can try installing PrestaShop v1.7.1.0 Beta in a separate directory and see if it has the same problem. It's better not to upgrade your existing site, since it's a beta and your problem may persist in the upgrade. Link to comment Share on other sites More sharing options...
aquaanimation Posted March 9, 2017 Author Share Posted March 9, 2017 The links are not displayed properly only on the backend in the section of related articles. Every other reference to the image works. I will try to search on that a little bit more. Thanks for your time. Link to comment Share on other sites More sharing options...
feamor Posted May 18, 2018 Share Posted May 18, 2018 @aquaanimation did you find any solution for this problem? same thing happens with my installation and I have no clue how to solve it. Link to comment Share on other sites More sharing options...
fakezzz Posted April 1, 2020 Share Posted April 1, 2020 same problem I have with 1.7.6.4 Link to comment Share on other sites More sharing options...
jmelich Posted May 5, 2020 Share Posted May 5, 2020 Same problem here in 1.7.5.1 Link to comment Share on other sites More sharing options...
CYGM Posted February 11, 2021 Share Posted February 11, 2021 This is something to do with not using the language with id 1. We have a store that uses lang 3 as the default, and lang 1 is disabled - this is causing broken images on the Related Products in admin, and is fixed if I add the link_rewrite for lang 1 of that product in the DB table ps_product_lang. Looks as though something is hardcoded to id_lang = 1 somewhere. Link to comment Share on other sites More sharing options...
Prestachamps Posted February 11, 2021 Share Posted February 11, 2021 Hi, you could try to configure for your Backoffice employee to have the Backoffice in the language id 3 . Let me know if this solves it for you. Kind regards, Leo Link to comment Share on other sites More sharing options...
humametaLab Posted March 4, 2021 Share Posted March 4, 2021 Same issue here. I solved it with: Two languages installed in: BO/International/Localization/Languages Backup your installation. Delete language with id: 1 (it should be English language) Related Products will work now. If you need English language, add it through: BO/International/Translations/"Add / Update a language" Keep in mind, that when you switch to the English language in BO/Your Profile (top right corner)/Language. When you will be adding product through "Related Products" field, the problem partially will be still here: Product image in search dropdown will be not displayed. However, page refresh after adding the related product - solves the issue. Hope this will help for the people looking for the solution. This is the Core bug. 1 Link to comment Share on other sites More sharing options...
devHeaven Posted July 6, 2022 Share Posted July 6, 2022 (edited) I solved it with: 1. add function getLanguageId to CategoryDataProvider class /src/Adapter/Category/CategoryDataProvider.php public function getLanguageId() { return $this->languageId; } 2. edit switch default: in function buildView in /src/PrestaShopBundle/Form/Admin/Type/TypeaheadProductCollectionType.php change: default: $product = $this->productAdapter->getProduct($id); $collection[] = [ 'id' => $id, 'name' => reset($product->name) . ' (ref:' . $product->reference . ')', 'image' => $product->image, ]; break; to: default: $id_lang=$this->categoryAdapter->getLanguageId(); $product = $this->productAdapter->getProduct($id,false,$id_lang); $collection[] = [ 'id' => $id, 'name' => ($product->name) . ' (ref:' . $product->reference . ')', 'image' => $product->image, ]; break; Edited January 27, 2023 by devHeaven (see edit history) 2 Link to comment Share on other sites More sharing options...
Prestafan1234 Posted May 7 Share Posted May 7 On 7/6/2022 at 2:57 PM, devHeaven said: I solved it with: 1. add function getLanguageId to CategoryDataProvider class /src/Adapter/Category/CategoryDataProvider.php public function getLanguageId() { return $this->languageId; } 2. edit switch default: in function buildView in /src/PrestaShopBundle/Form/Admin/Type/TypeaheadProductCollectionType.php change: default: $product = $this->productAdapter->getProduct($id); $collection[] = [ 'id' => $id, 'name' => reset($product->name) . ' (ref:' . $product->reference . ')', 'image' => $product->image, ]; break; to: default: $id_lang=$this->categoryAdapter->getLanguageId(); $product = $this->productAdapter->getProduct($id,false,$id_lang); $collection[] = [ 'id' => $id, 'name' => ($product->name) . ' (ref:' . $product->reference . ')', 'image' => $product->image, ]; break; Hi, I have this problem on both my own shops and lots of client's shops. I overlooked your step 1 and couldn't get it to work. So just for others: Step 1 should be added just after this code: class CategoryDataProvider { in /src/Adapter/Category/CategoryDataProvider.php Works for me now 🙂 Link to comment 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