Thanks. That seems to work fine, except now I am getting more than one of each of these things in the sidebar. The order is going like this:
Image
Attributes
Image
Attributes
Attributes
But I only have them displayed in the code one time. Any idea why multiple instances are being output?
Here is the code in case it will clear things up:
Code:
<!--JW - modified sidebar to display product information-->
<?php
if ($_GET['main_page'] == 'product_info')
{ ?>
<?php
$sql = "select p.products_id, pd.products_name, pd.products_description, pd.products_description2, pd.products_description3, p.products_model, p.products_quantity, p.products_image,
pd.products_url, p.products_price,
p.products_tax_class_id, p.products_date_added,
p.products_date_available, p.manufacturers_id, p.products_quantity,
p.products_weight, p.products_priced_by_attribute, p.product_is_free,
p.products_qty_box_status,
p.products_quantity_order_max,
p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_status = '1'
and p.products_id = '" . (int)$_GET['products_id'] . "'
and pd.products_id = p.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
$product_info = $db->Execute($sql);
if ($product_info->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {
$products_image = PRODUCTS_IMAGE_NO_IMAGE;
} else {
$products_image = $product_info->fields['products_image'];
}
// set flag for attributes module usage:
$flag_show_weight_attrib_for_this_prod_type = SHOW_PRODUCT_INFO_WEIGHT_ATTRIBUTES;
// get attributes
require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_ATTRIBUTES));
?>
<div id="sidebar_mod">
<!--bof Main Product Image -->
<?php
if (zen_not_null($products_image)) {
?>
<?php
/**
* display the main product image
*/
require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
<?php
}
?>
<!--eof Main Product Image-->
<br class="clearBoth" />
<!--bof Attributes Module-->
<?php
if ($pr_attr->fields['total'] > 0) {
?>
<?php
/**
* display the product attributes
*/
require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php'); ?>
<?php
}
?>
<!-- eof Attributes Module -->
</div><!--end sidebar mod-->
<?php } else { ?>
<!--End modified sidebar-->
...then the original sidebar code