Zen Cart Logo
Forums / All Other Contributions/Addons / merge lightbox with main picture product attribute

merge lightbox with main picture product attribute

Locked

Views: 764

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
18 Dec 2010, 10:08 PM
#1
bryanblue avatar

bryanblue

New Zenner

Join Date:
Oct 2009
Posts:
22
Plugin Contributions:
0

merge lightbox with main picture product attribute

Hi, i am back with more questions. i have zen cart light box installed. I plan to add attribute image module, which changes the main picture as i select through the attributes. My problem right now is that i installed the attribute image module, the main product image is fine with lightbox, but the when i click on larger picture of attributes it display in pop up window instead of lightbox.

what i am thinking is that the function in the tpl_modules_main_product_image.php is controling the main product image to show in lightbox. here is the file: ```php

<?php /** * Module Template * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: tpl_modules_main_product_image.php 3208 2006-03-19 16:48:57Z birdbrain $ */ ?> <?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?> <div id="productMainImage" class="centeredContent back"> <?php // bof Zen Lightbox 2008-12-15 aclarke ?> <?php if (ZEN_LIGHTBOX_STATUS == 'true') { if (ZEN_LIGHTBOX_GALLERY_MODE == 'true' && ZEN_LIGHTBOX_GALLERY_MAIN_IMAGE == 'true') { $rel = 'lightbox-g'; } else { $rel = 'lightbox'; } ?> <script language="javascript" type="text/javascript"><!-- document.write('<?php echo '<a href="' . zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="' . $rel . '" title="' . addslashes($products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>'); //--></script> <?php } else { ?> <?php // eof Zen Lightbox 2008-12-15 aclarke ?> <script language="javascript" type="text/javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>'); //--></script> <?php // bof Zen Lightbox 2008-12-15 aclarke ?> <?php } ?> <?php // eof Zen Lightbox 2008-12-15 aclarke ?> <noscript> <?php echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?> </noscript> </div> ```

and here is the file "i believe" which controls the way attribute image display. attrib_prod_info.php : ```php

<?php require('includes/application_top.php'); $products_options_values_id = $_REQUEST['products_options_values_id']; $alt = $_REQUEST['alt']; $width = $_REQUEST['width']; $height = $_REQUEST['height']; $products_id = $_REQUEST['products_id']; $sql = "select pa.attributes_image from " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products_id . "' and pa.options_values_id = '" . (int)$products_options_values_id ."'"; $account_query = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer'); $products_color_image = $db->Execute($sql); $attributes_image = $products_color_image->fields['attributes_image']; if($attributes_image!=''){ $image = zen_image('images/'.$attributes_image, $alt, $width, $height); ?> <?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'products_image_large_additional=' . 'images/'.$attributes_image) . '\')">' . $image . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?> <?php }?>

if i am right about this.....how do i merge these files so that attribute image will work with lightbox. if i am wrong then how do i fix this to work with lightbox?    and here is the link to my product. <http://www.vitabags.com/scarf/burberry-scottish-plaid-cashmere-scarf?zenid=t31c7ddmcvsq21qcr5h6vo8ll5>  Thanks