Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Attribute image popup

Attribute image popup

Locked

Views: 3,757

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
18 May 2006, 12:26 PM
#1
patski avatar

patski

Zen Follower

Join Date:
Nov 2004
Location:
Deal, Kent, UK
Posts:
325
Plugin Contributions:
0

Attribute image popup

I looked at this thread http://www.zen-cart.com/forum/showthread.php?t=19021&highlight=attribute+popup which is exactly what I want to do.

I've tried looking at the main_template_vars_images in modules/pages/product_info and tried to fathom the logic to insert it into the main_template_vars_attributes.php (I assume this is where it would go?) but it's beyond me!

Can anyone help me out please? I'm using 1.2.6, radio buttons, case 3.

20 May 2006, 12:37 PM
#2
patski avatar

patski

Zen Follower

Join Date:
Nov 2004
Location:
Deal, Kent, UK
Posts:
325
Plugin Contributions:
0

Re: Attribute image popup

More information:

This is the code that pulls in the attribute images in tpl_product_info_display.php

  <?php
if ($options_attributes_image[$i] != '') {
?>
      <tr>
        <td colspan="2"><table class="products-attributes-images">
            <tr> <?php echo $options_attributes_image[$i]; ?> </tr>
        </table></td>
      </tr>

And this is the code that pulls in the main image:

 if (zen_not_null($products_image)) {
    require(DIR_WS_MODULES . 'pages/' . $current_page_base . '/main_template_vars_images.php');
  } else {
    echo ' ';
  }
?>

So I initially tried copying the main_template_vars_image file and replacing all products_image with attributes_image to see what happened and then used a require statement in tpl_product_info_display to reference it. However I got an error unsurprisingly - ereg_replace(): REG_EMPTY

So I am stuck.

if this isn't the way to go then can I amend the main_template_vars_attributes script:

 case '3':
                  $tmp_attributes_image_row++;

//                  if ($tmp_attributes_image_row > PRODUCTS_IMAGES_ATTRIBUTES_PER_ROW) {
                  if ($tmp_attributes_image_row > $products_options_names->fields['products_options_images_per_row']) {
                    $tmp_attributes_image .= '</tr><tr>';
                    $tmp_attributes_image_row = 1;
                  }

                if ($products_options->fields['attributes_image'] != '') {
                  $tmp_attributes_image .= '<td class="smallText" align="center" valign="top">' . zen_draw_radio_field('id[' . $products_options_names->fields['products_options_id'] . ']',
                              $products_options_value_id, $selected_attribute) . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' . $products_options->fields['products_options_values_name'] : '') . $products_options_details_noname . '</td>';
                } else {
                  $tmp_attributes_image .= '<td class="smallText" align="center" valign="top">' . zen_draw_radio_field('id[' . $products_options_names->fields['products_options_id'] . ']',
                              $products_options_value_id, $selected_attribute) . '<br />' . $products_options->fields['products_options_values_name'] . $products_options_details_noname . '</td>';
                }
              break;

without having a require statement to create a popup? Help would be very much appreciated.

21 May 2006, 8:02 PM
#3
patski avatar

patski

Zen Follower

Join Date:
Nov 2004
Location:
Deal, Kent, UK
Posts:
325
Plugin Contributions:
0

Re: Attribute image popup

Still struggling with this - can anyone help out please....:dontgetit

Thanks

23 May 2006, 9:17 PM
#4
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: Attribute image popup

For your reference.

Color attribute images zoom when mouse is placed over them
Images Zoom On Mouseover (hover) - V2, Fullblown

A New Starter again

23 May 2006, 11:55 PM
#5
patski avatar

patski

Zen Follower

Join Date:
Nov 2004
Location:
Deal, Kent, UK
Posts:
325
Plugin Contributions:
0

Re: Attribute image popup

Thanks. It's definitely an option but I would really like to solve the popup solution if possible.

In the meantime I've deleted the attribute swatches and have created new additional images to include the attribute title - changing the option value to a dropdown instead of radio buttons. Reason I'd like the swatch popup is if the swatch images aren't easily identifiable when using additional images (for example fabric patterns or abstract designs) the attribute value title automatically shows.

19 Jul 2006, 11:57 PM
#6
borzoid avatar

borzoid

Totally Zenned

Join Date:
Feb 2004
Location:
Michigan
Posts:
589
Plugin Contributions:
1

Re: Attribute image popup

Does this contribution work in 1.3.X and are there changes to the installation instructions?

Connie Taylor