Post by stfn » Thu Sep 15, 2016 7:30 pm

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.

New member

Posts

Joined
Wed Oct 09, 2013 6:30 pm

Post by dharam81 » Fri Dec 16, 2016 6:12 pm

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

Active Member

Posts

Joined
Mon Apr 30, 2012 8:26 pm

Post by artcore » Fri Dec 16, 2016 6:42 pm

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...

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by dharam81 » Fri Dec 16, 2016 10:46 pm

i managed to test this so this is no more untested.

that worked like charm :)

thanks you so much :)

Active Member

Posts

Joined
Mon Apr 30, 2012 8:26 pm

Post by artcore » Sat Dec 17, 2016 12:13 am

Glad it worked, thanks for posting back ;D

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by siteadvice » Thu Feb 18, 2021 12:45 am

I can confirm this method still works in Opencart 3.

inframes.com Website Design with Opencart, Wordpress, Lucee and bespoke application design and development


User avatar
New member

Posts

Joined
Mon Oct 24, 2011 8:12 pm
Who is online

Users browsing this forum: No registered users and 25 guests