Answer the question
In order to leave comments, you need to log in
How to make a stub for pictures of products that have been deleted from the server in opencart?
Hey! Please tell me, I've been surfing the Internet, but I'm already giving up. In general, the addresses to the pictures of the goods are registered in the database, and during the transfer (or for some other reason, I don’t know the subtleties), they were not loaded. And opencart sculpts empty in this case, but I want it to load "no_image.png"
something tells me that I need to add a check in model/tool/image.php, but this is just intuition. After all, this check for the presence of a picture should be everywhere, both in modules, and in the catalog and in the product.
Opencart original version 2.1
thank you in advance!!!
Answer the question
In order to leave comments, you need to log in
Why the fuss, opencarts, shmersia versions...
A solution that spits on these most insignificant mundane problems:
$('img').on('error', function(){
$(this).attr('src', 'no-image.jpg');
});
Previously there was a .error method, but in my opinion it was kicked out of the library in disgrace, like its accomplices like .delegate
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question