Post by marcuslane » Thu Feb 16, 2012 1:31 am

Hello first off I am really new to opencart, I just installed recently and it's great! I was wondering if its possible to use a default image for products without an image. I have been searching on google, but I have been unsuccessful. Thanks :)

Newbie

Posts

Joined
Thu Feb 16, 2012 1:29 am

Post by Moggin » Thu Feb 16, 2012 1:43 am

There's one in the default Opencart download ...image/cache/no_image

It appears automatically on products with no image. Very easy.
You can place a copy in your image folder too: comes in handy if you need to remove an image, as you can just swop any redundant pictures for the no-image.jpg.

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by marcuslane » Thu Feb 16, 2012 2:01 am

Thanks for the quick reply! For some reason the default image is not showing up on the front-end I made sure the images file was 777 and the sub folders. Do I have to enable something?

Newbie

Posts

Joined
Thu Feb 16, 2012 1:29 am

Post by Moggin » Thu Feb 16, 2012 3:07 am

Moggin wrote:It appears automatically on products with no image. Very easy.
hmm, sorry, let 's correct that. It appeared automatically on older versions of OC, but this feature seems to be missing in 1.5x. No idea why. :crazy:

However, you can still upload the no-image.jpg to your main image folder, and click on it to add it to your product page.

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by Qphoria » Thu Feb 16, 2012 5:52 am

To add it back to 1.5.x

1. EDIT: admin/controller/catalog/product.php

2. FIND:

Code: Select all

$this->data['image'] = '';
3. REPLACE WITH:

Code: Select all

$this->data['image'] = 'no_image.jpg';
The no_image.jpg file is in the root "image" folder as opposed to "image/data" where all uploaded images go.
Replace that with your own default image and you should be set for future inserts

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Moggin » Thu Feb 16, 2012 8:44 am

Thank you. : )

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by preto » Tue Nov 06, 2012 3:19 am

Is it supposed to work in whole site, like product, category, search areas?
I tried this but doen'st work. There are some extensions that do this by editing each respective controller

Newbie

Posts

Joined
Wed Mar 07, 2012 4:25 am

Post by Joxe » Fri Feb 22, 2013 5:28 pm

Qphoria wrote:To add it back to 1.5.x

1. EDIT: admin/controller/catalog/product.php

2. FIND:

Code: Select all

$this->data['image'] = '';
3. REPLACE WITH:

Code: Select all

$this->data['image'] = 'no_image.jpg';
The no_image.jpg file is in the root "image" folder as opposed to "image/data" where all uploaded images go.
Replace that with your own default image and you should be set for future inserts
Hi Q,

It didn't work for me. I'm running v.1.4.9.6.
By mistake I deleted a image folder and now all the products that had an image in this folder have no image at all :/

v. 1.4.9.6 & v. 2.0.2.0


Active Member

Posts

Joined
Wed Apr 28, 2010 6:12 am

Post by beattie » Thu Jul 04, 2013 8:29 am

Many thanks Qphoria. I found your solution very useful and easy to implement. I created a VQmod for OC v.1.5.5.1. If anyone wants to use it, you can download it free here:
http://www.opencart.com/index.php?route ... n_id=12529

New member

Posts

Joined
Tue May 22, 2012 11:33 am
Location - Australia

Post by kelemvor » Sun Jul 21, 2013 12:47 pm

Hmm,

I can see my "no_image" image when I view the product list in the admin tool, but the image doesn't show up when I view the product from the front end. Any idea what would cause that? 1.5.5.1.

Active Member

Posts

Joined
Fri Oct 12, 2012 6:58 am

Post by justcurious » Sun Jul 21, 2013 4:10 pm

Yes, you will need to edit catalog/controller/product/product.php in the same way that Qphoria outlined earlier in this thread.

Same goes for category, featured, latest, special etc. modules. Find the appropriate controller in the catalog/controller folder and make the edit.

Google Product Feed - Get your products into Google Shopping. Includes a bulk update facility.
Backup Pro - Backup (on demand or scheduled), Restore and Clone your store.
Freestyle Box - Add multiple information boxes on multiple pages of your store. Includes optional "Code Mode".
View my other extensions


User avatar
Active Member

Posts

Joined
Sat Dec 24, 2011 4:36 pm
Location - UK
Who is online

Users browsing this forum: No registered users and 87 guests