Forums / Templates, Stylesheets, Page Layout / Additional Images on Product Listing Page

Additional Images on Product Listing Page

Locked

Views: 3,757

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
8 Jul 2009, 5:57 AM
#1
sundoggin avatar

sundoggin

New Zenner

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

Additional Images on Product Listing Page

I have searched the forums extensively and have tried numerous options and am at a total loss. Please let me know if this listing should be placed elsewhere - I thought this was the best place for this question.

I am building a clothing store for a client. Many of the items have an additional image such as an image of a back of a shirt for instance. I am trying to figure out how to show the additional image to the right of the product main image on the product listing 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 of code if I can only just find where to paste it.

8 Jul 2009, 8:55 AM
#2
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Additional Images on Product Listing Page

you can look at tpl_product_info_display.php .. there you can move the code block that calls tpl_modules_additional_images.php to any location you want.

8 Jul 2009, 9:01 PM
#3
sundoggin avatar

sundoggin

New Zenner

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

Re: Additional Images on Product Listing Page

tony_sar:

you can look at tpl_product_info_display.php .. there you can move the code block that calls tpl_modules_additional_images.php to any location you want.

Tony, I have tried placing the following code from tpl_product_info_display.php ...

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

...in several places within the tpl_modules_product_listing.php page to no avail. Where would I put this code to get the available additional image to display to the right of the main image on the product listing page?

8 Jul 2009, 10:49 PM
#4
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Additional Images on Product Listing Page

you might want to move it , under Product Price ?? . however, once there , you need to use CSS to position additional images if they are not already aligned correctly . this is easier then using CSS to position where you want those images from default location.

once you moved the code , supply us with link to your site , so we might be able to help out with CSS .

8 Jul 2009, 10:59 PM
#5
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Additional Images on Product Listing Page

sundoggin:

Tony, I have tried placing the following code from tpl_product_info_display.php ...

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

> 
> ...in several places within the tpl_modules_product_listing.php page to no avail.  Where would I put this code to get the available additional image to display to the right of the main image on the product listing page?

you have to modify tpl_product_info_display.php and NOT tpl_product_listing.php ..
9 Jul 2009, 2:31 AM
#6
sundoggin avatar

sundoggin

New Zenner

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

Re: Additional Images on Product Listing Page

tony_sar:

you have to modify tpl_product_info_display.php and NOT tpl_product_listing.php ..

I have modified tpl_product_info_display.php. This only affects the main product page layout. I need the additional image to show up next to the main image on the category/product listing page (index.php?main_page=index&cPath=#_#)

9 Jul 2009, 8:34 AM
#7
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Additional Images on Product Listing Page

ok , i misunderstood. if you can get additional images showing in product listing , then you need to use CSS to position them correctly . :smile:

9 Jul 2009, 4:43 PM
#8
sundoggin avatar

sundoggin

New Zenner

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

Re: Additional Images on Product Listing Page

I have not been able to get the additional images to appear on the product listing page. I have tried copying the ```php
require($template->get_template_dir('/tpl_modules_additional_images.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_additional_images.php'); ?>

 
Any thoughts or ideas?
22 Jul 2009, 3:51 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Additional Images on Product Listing Page

You'll have to do some fancy coding, including studying the code for the additional_images module, and then incorporating that into the various scripts that drive the product_listing module, preparing all the variables needed by the templates used by the product listing module, and then altering the product listing module to display the data ... and what to do if no image is available, too.
It's a very involved task.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

22 Jul 2009, 9:01 PM
#10
sundoggin avatar

sundoggin

New Zenner

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

Re: Additional Images on Product Listing Page

drbyte, I do so appreciate your insight! With your response, I have determined that this mod is far more involved than I had anticipated and thusly is way out of my league. I am a designer first, programmer second and have beginner-intermediate PHP development skills. I would be ecstatic if anyone else would decide to take this on, but for the time being I am going to either a) nix the idea or b) find an alternate solution. Let me know if you have any parting thoughts, or other resources to ping. Thanks.

6 May 2010, 9:49 PM
#11
2000pesos avatar

2000pesos

New Zenner

Join Date:
May 2010
Posts:
1
Plugin Contributions:
0

Re: Additional Images on Product Listing Page

Hey, i know this isn't exactly the solution to your problem, but I spent most of the day trying to get the product listing image to popup the additional images, as it does on the product info page.
It's not the exact solution your looking for but the code might help you figure it out. I'm also working on a clothing store, so maybe if you just want to adopt this it's fine.

In tpl_modules_products_all_listing.php

if (PRODUCT_ALL_LIST_IMAGE != '0') {
        if ($products_all->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
          $display_products_image = str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));
        } else {
          $display_products_image = '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $products_all->fields['products_id']) . '" target="_blank">' . '<div style="height:179px;width:170px;background-image:url(/zentemplates/images/bg2.png) ;background-position:center center;">' . '<div style="height:150px;width:150px;padding-top:19px;">' . zen_image(DIR_WS_IMAGES . $products_all->fields['products_image'], $products_all->fields['products_name'], IMAGE_PRODUCT_ALL_LISTING_WIDTH, IMAGE_PRODUCT_ALL_LISTING_HEIGHT) . '</div>' . '</div>'. '</a>' .  str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));
        }
      } else {
        $display_products_image = '';
      }

and if you want it to work with a lightbox

if (PRODUCT_ALL_LIST_IMAGE != '0') {
        if ($products_all->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
          $display_products_image = str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));
        } else {
        $display_products_image = '<a href="' . zen_lightbox(DIR_WS_IMAGES . $products_all->fields['products_image'], $products_all->fields['products_name'] , LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="' . $rel . '">' . '<div style="height:179px;width:170px;background-image:url(/zentemplates/images/bg2.png) ;background-position:center center;">' . '<div style="height:150px;width:150px;padding-top:19px;">' . zen_image(DIR_WS_IMAGES . $products_all->fields['products_image'], $products_all->fields['products_name'], IMAGE_PRODUCT_ALL_LISTING_WIDTH, IMAGE_PRODUCT_ALL_LISTING_HEIGHT) . '</div>' . '</div>'. '</a>' .  str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));
        }
      } else {
        $display_products_image = '';
      }