Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Medium Image in Featured sidebox

Medium Image in Featured sidebox

Locked

Views: 909

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
25 Aug 2008, 12:43 PM
#1
lbooth avatar

lbooth

New Zenner

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

Medium Image in Featured sidebox

Anyone know how I can use a products medium image in the featured sidebox, rather than the default small? I have Image Handler 2 installed.....?

Cheers
Lee

26 Aug 2008, 5:44 PM
#2
lbooth avatar

lbooth

New Zenner

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

Re: Medium Image in Featured sidebox

ok, can anyone explain this function then, please...!

zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);

I understand that it builds <img> tag src, name, alt, width, hight but how does DIR_WS_IMAGES work..?

I try adding

<?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); and using zen_image($products_image_medium, addslashes($products_name), FEATURED_PRODUCTS_WIDTH, FEATURED_PRODUCTS_HEIGHT) but understand that this will only work on the actual product page when product id id defined. Any ideas, I just need a push in the write direction...??:lookaroun
10 Sep 2008, 8:04 AM
#3
lbooth avatar

lbooth

New Zenner

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

Re: Medium Image in Featured sidebox

Any ideas on the above, just coming to the end of a 4 month build and if I can't resolve this it's time for a re-think / re-design..?

Cheers
Lee

11 Sep 2008, 10:19 AM
#4
lbooth avatar

lbooth

New Zenner

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

Re: Medium Image in Featured sidebox

Had one last try and it was easy!

This might not be the right way to do it but I rebuilt the image link by using the small image name and stripping out the extension and adding _med etc.

$image_path = $random_featured_product->fields['products_image'];
$image_path = substr($image_path, 0 , -4);
$med_path = "_MED.jpg";

Using the origanal link

$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"]) . '">';

Adding the medium image

$content .= '<img src="images/medium/' . $image_path . $med_path . '" alt="' . $random_featured_product->fields["products_name"] . '"' . '"/>';

Closing the image link

$content .= '</a>';

Cheers
Lee