gfasal, on 26 September 2011, 19:29, said:
I have quite a heavily modified Product_info.php page - is there a manual that shows what lines to change or add?
Replace/edit (arround line 35) product query by adding
p.products_images after
p.products_image
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, 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 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
with
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_images, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
Since we don't need another query to table TABLE_PRODUCTS_IMAGE, remove line related to it, and replace with following code
<?php
if (tep_not_null($product_info['products_image'])) {
$pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order");
$products_images = explode(',', $product_info['products_images']);
//if (tep_db_num_rows($pi_query) > 0) {//
if (sizeof($products_images) > 1) {
?>
<div id="piGal" style="float: right;">
<ul>
<?php
$pi_counter = 0;
foreach ($products_images as $pi) {
$pi_counter++;
$pi_entry = ' <li><a href="';
$pi_entry .= tep_href_link(DIR_WS_IMAGES . 'thumbs/def/large/' . $pi);
$pi_entry .= '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'thumbs/def/display/' . $pi) . '</a>';
$pi_entry .= '</li>';
echo $pi_entry;
}
?>
</ul>
</div>
<script type="text/javascript">
$('#piGal ul').bxGallery({
maxwidth: 300,
maxheight: 200,
thumbwidth: <?php echo (($pi_counter > 1) ? '75' : '0'); ?>,
thumbcontainer: 300,
load_image: 'ext/jquery/bxGallery/spinner.gif'
});
</script>
<?php
} else {
?>
<div id="piGal" style="float: right;">
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . 'thumbs/def/large/' . $product_info['products_image']) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'thumbs/def/display/' . $product_info['products_image'], addslashes($product_info['products_name']), null, null, 'hspace="5" vspace="5"') . '</a>'; ?>
</div>
<?php
}
?>
<script type="text/javascript">
$("#piGal a[rel^='fancybox']").fancybox({
cyclic: true
});
</script>
<?php
}
?>
If you want to see it in action, here my modified products_info.php page
http://www.rhinebutik.com/id/product_info.php?products_id=2 . Fell free to try because I disable create account and checkout.
@zaenal