Page 1 of 1

default image for every multistore?

Posted: Thu Sep 15, 2016 7:30 pm
by stfn
Hi,
I'm running a multistore with OC 2.0.3.1. I have a default (no_image) in my image folder, so when a product has no picture this default image comes in place. Is there a way to set this image for every store so I can have a different default picture per store. Now all the stores have the same default. I'd like to give each store its own default.

Re: default image for every multistore?

Posted: Fri Dec 16, 2016 6:12 pm
by dharam81
Hi i need this solution too, did you find any please?
i wanted to used no_image1.png for store1 default and no_image2.png for store2 default

please help

Re: default image for every multistore?

Posted: Fri Dec 16, 2016 6:42 pm
by artcore
You can try the following, untested!
Add to catalog/model/tool/image.php these lines directly under the resize method:

Code: Select all

if($filename === 'no_image.png'){
			$filename = 'no_image'.$this->config->get('config_store_id').'.png';
		}
Screenshot_2016-12-16-11-36-31.jpg
Don't forget to add the images like: no_image0.php, no_image1.png, etc.
Or use placeholder.png in a similar way.
Hope it helps...

Re: default image for every multistore?

Posted: Fri Dec 16, 2016 10:46 pm
by dharam81
i managed to test this so this is no more untested.

that worked like charm :)

thanks you so much :)

Re: default image for every multistore?

Posted: Sat Dec 17, 2016 12:13 am
by artcore
Glad it worked, thanks for posting back ;D

Re: default image for every multistore?

Posted: Thu Feb 18, 2021 12:45 am
by siteadvice
I can confirm this method still works in Opencart 3.