Post by TheMasterBrewer » Mon Oct 24, 2011 9:18 pm

Does anybody know how to include the main/default product image in the set of thumbnails? I've tried playing around with the code for the main image in the foreach loop but it always displays it full size... help!
Last edited by TheMasterBrewer on Wed Oct 26, 2011 9:39 pm, edited 1 time in total.

Active Member

Posts

Joined
Mon Oct 17, 2011 8:01 pm


Post by TheMasterBrewer » Wed Oct 26, 2011 9:38 pm

I've solved this issue. In the product controller (catalog/controller/product/product.php) I added the following code around line 207:

Code: Select all

if ($product_info['image']) {
	$this->data['mainthumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'));
} else {
	$this->data['mainthumb'] = '';
}
This is pretty much a clone of the previous two if statements; the first of which creates the enlarged version of the main image ('popup'), the second of which creates the default version of the main image ('image'). This new code creates a third version of the image, the same size as the thumbnails, and calls it "mainthumb". Then I called the 'mainthumb' image (the same way the product template calls the default image) just before the foreach loop on the product page where it displays all the thumbnails. Hey presto!

Active Member

Posts

Joined
Mon Oct 17, 2011 8:01 pm


Post by Ampeter » Wed Nov 30, 2011 11:39 pm

Great! thanks. I made it into a vQmod here: http://forum.opencart.com/viewtopic.php?f=131&t=47303

User avatar
New member

Posts

Joined
Thu Jan 13, 2011 5:01 pm
Who is online

Users browsing this forum: No registered users and 13 guests