Forums / Templates, Stylesheets, Page Layout / Adding Additional Images to Product Listing Page

Adding Additional Images to Product Listing Page

Locked

Views: 1,652

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
20 Jul 2009, 6:48 PM
#1
sundoggin avatar

sundoggin

New Zenner

Join Date:
Jul 2009
Posts:
13
Plugin Contributions:
0

Adding Additional Images to Product Listing Page

Does anyone know of a way to get the additional image from the product info page to appear as a thumbnail next to the main product image thumb on the product listing page?

I am building a clothing store for a client. Many of the items have an additional image of the back of a shirt for instance. I am trying to figure out how to show the additional image next to the right of the product main image on the product listing page (not the product info page). I have tried modifying code on tpl_modules_product_listing.php, tpl_modules_main_product_image.php, additional_images.php, tpl_modules_additional_images.php, and product_listing.php and I am having no luck on locating the code where I can make this happen.

Can anyone tell me how to accomplish this? It seems like it should be a simple copy and paste of this code...
PHP Code:

require($template->get_template_dir('/tpl_modules_additional_images.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_additional_images.php'); ?> 

...if I can only just find where to paste it.

Your help is greatly appreciated.

Original Thread http://www.zen-cart.com/forum/showth...d=1#post752491

21 Jul 2009, 9:23 PM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Adding Additional Images to Product Listing Page

Just a suggestion:

Why not edit the two images together in a graphics program? Then they would both be displayed.

Just an idea.

You are going to need to get stuck into product_listing.php to do it the php route. And it won't be as simple as a easy require statement I don't think.

Nick
iszent.com

21 Jul 2009, 10:59 PM
#3
sundoggin avatar

sundoggin

New Zenner

Join Date:
Jul 2009
Posts:
13
Plugin Contributions:
0

Re: Adding Additional Images to Product Listing Page

Niccol, i have played around with both product_listing.php, and tpl_modules_product_listing.php and still can not get the image to appear. I think it might work if I can add an extra field definition for the additional image in this block of code from product_listing.php. However I've tried several times and don't know how exactly to write the code. Let me know if you have a suggestion.

          if (isset($_GET['manufacturers_id'])) {
            $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';

Also,

Why not edit the two images together in a graphics program? Then they would both be displayed.

the idea behind displaying the front(default) and back(additional) images side by side is to make it easy for the client to upload new products to the shopping cart, and to keep the image system clean.

23 Jul 2009, 9:34 AM
#4
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Adding Additional Images to Product Listing Page

OK,well that makes sense, it was just a suggestion of an easy work around.

You are going to have to try and merge the code from additional_images.php (this creates an array of the additional images which is used by tpl_columnar_display) with the ' case 'PRODUCT_LIST_IMAGE' section of product_listing.php (which also produces an array that is then used by tpl_columnar_display).

Or thats how I would start to think about it...

You can probably simplify the code quite a bit if you know that there is going to be only a single additional image :smile:

Nick
iszent.com