If this is your first visit, check our documentation. To post, register or login.
Forums / Templates, Stylesheets, Page Layout / Featured Sidebox - Changing Image Size

Featured Sidebox - Changing Image Size

Locked

Started by donn on 12 Jun 2009, 10:51 PM · Views: 1,618

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
12 Jun 2009, 10:51 PM
#1
donn avatar

donn

Zen Follower

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

Featured Sidebox - Changing Image Size

I'm trying to keep the image size in the featuredf sizebox under control. The default is the small image size, which doesn't work in my instance; it is a bit too big.

So, I found the file TPL_FEATURED.PHP in the sideboxes template directory of ZC 3.8A.

Line 17:

$content .= '<a href="' . zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' . $random_featured_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);

I tried changing the SMALL_IMAGE_WIDTH to
'width="90"' but it didn't change anything.

What is the correct means of changing this image size?

Thank you!

Donn

12 Jun 2009, 11:26 PM
#2
donn avatar

donn

Zen Follower

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

Re: Featured Sidebox - Changing Image Size

Additional Info...

I had a similar issue with the Manufacturer's Image in the Sidebox.

A solution was presented on this board and it worked.

http://www.zen-cart.com/forum/showthread.php?t=119585

I would like to do something similar for the featured sidebox, as it allowed the size to be changed in admin, and it functioned properly, resizing the image as per my settings.

13 Jun 2009, 5:53 AM
#3
donn avatar

donn

Zen Follower

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

Re: Featured Sidebox - Changing Image Size

To continue....

I used the example cited in the above response to my initial post

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 ('Featured Sidebox Image Width', 'IMAGE_FEATURED_WIDTH', 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 ('Featured Sidebox Image Height', 'IMAGE_FEATURED_HEIGHT', '80', 'Default = 80', 4, 81, NULL, NOW(), NULL, NULL);

I am unsure why there is a '4' and a '81' in there. Therefore, I don't know if I should change those values.

and change the code in tpl_featured.php from...

$content .=  '<a href="' . zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' . $random_featured_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); 
   

...to...

$content .=  '<a href="' . zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' . $random_featured_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], IMAGE_FEATURED_WIDTH, IMAGE_FEATURED_HEIGHT); 
   

Any feedback would be much appreciated, as I would rather not try this without knowing it will work.