Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Changing Manufacturer's Image Size in 'Manufacturers Info' Side Box

Changing Manufacturer's Image Size in 'Manufacturers Info' Side Box

Views: 4,772

Results 1 to 7 of 7
7 Feb 2009, 1:47 AM
#1
donn avatar

donn

Zen Follower

Join Date:
Oct 2007
Posts:
241
Plugin Contributions:
0

Changing Manufacturer's Image Size in 'Manufacturers Info' Side Box

**Hi Forum Users.....

I've been trying to find a way to control the size of the image in the Manufacturer's Info sidebox that appears when in item description.

Where is the variable the controls such stored, and is there an easy way to change it from the Admin controls?

Thanks!

Donn**

7 Feb 2009, 3:11 AM
#2
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Changing Manufacturer's Image Size in 'Manufacturers Info' Side Box

In a default cart the manufacturer image doesn't have admin-configurable dimensions: it just displays the stored image at it's natural size.

To make the image size controllable from Admin, you'll need to add a couple of configuration keys to the database. Copy the query below and paste it into the box at Admin > Tools > Install SQL Patches, then click the Send button. You'll then have the two new configuration keys available to edit at the bottom of the page at Admin > Configuration > Images.

INSERT INTO configuration (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Manufacturer Sidebox Image Width', 'IMAGE_MANUFACTURER_WIDTH', '100', 'Default = 100', 4, 80, NULL, NOW(), NULL, NULL);
INSERT INTO configuration (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Manufacturer Sidebox Image Height', 'IMAGE_MANUFACTURER_HEIGHT', '80', 'Default = 80', 4, 81, NULL, NOW(), NULL, NULL);

Now you'll have to make an override copy of includes/templates/template_default/sideboxes/tpl_manufacturer_info.php and edit that new file to change this section of code:

 zen_image(DIR_WS_IMAGES . $manufacturer_info_sidebox->fields['manufacturers_image'], $manufacturer_info_sidebox->fields['manufacturers_name'])

to this:

zen_image(DIR_WS_IMAGES . $manufacturer_info_sidebox->fields['manufacturers_image'], $manufacturer_info_sidebox->fields['manufacturers_name'], IMAGE_MANUFACTURER_WIDTH, IMAGE_MANUFACTURER_HEIGHT)

Neville
An assumption is what you arrive at when you get tired of thinking...

7 Feb 2009, 7:38 PM
#3
donn avatar

donn

Zen Follower

Join Date:
Oct 2007
Posts:
241
Plugin Contributions:
0

Re: Changing Manufacturer's Image Size in 'Manufacturers Info' Side Box

bunyip:

In a default cart the manufacturer image doesn't have admin-configurable dimensions: it just displays the stored image at it's natural size.

To make the image size controllable from Admin, you'll need to add a couple of configuration keys to the database. Copy the query below and paste it into the box at Admin > Tools > Install SQL Patches, then click the Send button. You'll then have the two new configuration keys available to edit at the bottom of the page at Admin > Configuration > Images.

OK, thanks...I applied the SQL patch and it worked!! :smile:

I was trying to find the manufacturers info file among the various tpl*.php files. (It seemed the TPL files all deal with screen output, so I figured there should be a TPL file for this, too.)

I was looking for the manufacturer info tpl file, but I didn't even realize it SHOULD be in the sidebox folder, and so I didn't look there. :dontgetit

26 May 2009, 6:42 PM
#4
makoshark avatar

makoshark

Zen Follower

Join Date:
Jun 2007
Location:
Laurinburg, NC
Posts:
165
Plugin Contributions:
0

Re: Changing Manufacturer's Image Size in 'Manufacturers Info' Side Box

It was hard to find but I did find it and used it. Works Great and I used the template override system: > /home /www /shop.nilandsplace.com /camp /includes /templates /Your custom template /sideboxes/ tpl_manufacturer_info.phpThanks James AKA Makoshark

27 May 2009, 1:13 AM
#5
makoshark avatar

makoshark

Zen Follower

Join Date:
Jun 2007
Location:
Laurinburg, NC
Posts:
165
Plugin Contributions:
0

Re: Changing Manufacturer's Image Size in 'Manufacturers Info' Side Box

I got the code right the first time:D

If anyone wants to see this in action I have set up a test account. So please do not create accounts for testing

You can use this to test. User: [email protected] and the password is test1234
Here is my website click Nilands Place CampsiteHave Fun makoshark AKA James

15 Apr 2010, 1:18 PM
#6
cactusjuice avatar

cactusjuice

New Zenner

Join Date:
Apr 2010
Posts:
4
Plugin Contributions:
0

Re: Changing Manufacturer's Image Size in 'Manufacturers Info' Side Box

That code mod worked like a charm! You're my Zencart hero! :clap:

5 Feb 2011, 7:29 AM
#7
swarmretail avatar

swarmretail

New Zenner

Join Date:
Feb 2011
Posts:
3
Plugin Contributions:
0

Re: Changing Manufacturer's Image Size in 'Manufacturers Info' Side Box

bunyip thanks for your easy to follow, perfect solution!