0

Magento 2 thumbnail main image cache path link changed from this link on the home page after 2 days pub/media/catalog/product/cache/be293bf7411b924394287949fb9084eb/b/e/be-in-in.png

to this

media/catalog/product/cache/be293bf7411b924394287949fb9084eb/b/e/be-in-in.png

because of that, I am getting this

but when do flush Magento cache it changes back to

pub/media/catalog/product/cache/be293bf7411b924394287949fb9084eb/b/e/be-in-in.png

please can anyone give me suggestion to solve this issue?

thanks

1 Answer 1

0

You need to create a custom module to be able to change the image path

Create that Block class and extend \Magento\Framework\Data\Form\Element\Image

namespace VendorName\ModuleName\Helper\Image;

class Custom extends \Magento\Framework\Data\Form\Element\Image

{
    public function _getUrl()
    {   
        $url = 'YourModulePath'.$this->getValue(); 
        return $url;
    }
}
5
  • but i am not getting any issue on beta site this only happens after 2 or 3 days the image path is changed automatically Commented Jun 7, 2021 at 7:38
  • and this issue is only occur on home page all other page is getting the image Commented Jun 7, 2021 at 7:39
  • The path containing the image is a fixed URL and it will not change unless you intervene and these links. You can check that the extensions you are using and especially the theme you are using are calling the correct image link. Commented Jun 10, 2021 at 2:21
  • the issue is images are not visible only on the homepage but visible on all frontend pages Commented Jun 21, 2021 at 7:26
  • Have you deployed and re-run the indexer for your site? If not, please run the commands one by one: php bin/magento setup:static-content:deploy php bin/magento indexer:reindex Commented Jul 1, 2021 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.