The error I received was:
Code:
<!-- bof: Tabbed Product Lite Modifications -->
<!-- Tabbed Products Lite v3.8 :: 25-Oct-2006 :: (tpl_tabbed_products_lite.php) -->
<div id="slidetabsmenu" style="display:none;">
<ul>
<li><a href="javascript:void(0)" onclick="expandcontent('sc1', this)"><span>Product Description</span></a></li>
<div class="systemError">1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX_DISPLAY_XSELL' at line 8<br />in:<br />[select distinct p.products_id, p.products_image, pd.products_name
from TABLE_PRODUCTS_XSELL xp, zen_products p, zen_products_description pd
where xp.products_id = '1'
and xp.xsell_id = p.products_id
and p.products_id = pd.products_id
and pd.language_id = '1'
and p.products_status = 1
order by xp.sort_order asc limit MAX_DISPLAY_XSELL]<br /></div>
But was only apparent after looking at the source, the page stopped rendering after this point; this was the end of the page...
After comparing the error in the source and the corresponding file containing the offending SQL query, I commented out this block of PHP, starting at line 119:
PHP Code:
// ===> Check if Cross Sell should be a tab or not (tabstrip)
if ($bCrossSell_Tab != false) {
$xsell_query = $db->Execute("select distinct p.products_id, p.products_image, pd.products_name
from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where xp.products_id = '" . $_GET['products_id'] . "'
and xp.xsell_id = p.products_id
and p.products_id = pd.products_id
and pd.language_id = '" . $_SESSION['languages_id'] . "'
and p.products_status = 1
order by xp.sort_order asc limit " . MAX_DISPLAY_XSELL);
$num_products_xsell = $xsell_query->RecordCount();
if ($num_products_xsell != 0) {
echo '<li><a href="javascript:void(0)" onclick="expandcontent(\'sc'.$g.'\', this)"><span>'.$cross_sell_tab_name.'</span></a></li>' . "\n";
$g++;
}
}
Here's the url of a sample page on the site before I set up Tabbed Products LITE
http://tinyurl.com/3yeuuu
Anddd here's a link to the b0rked page:
http://tinyurl.com/2eqzb5
Even though /dev is a fresh install with my template, I'm perfectly willing to concede it's an error on my part, and my solution is lame and hacky, definitely not long term. I just want to understand what happened.. I have a sneaking suspicion it has something to do with the naming of the tables and the naming conventions in the version of Zen Cart I have installed.
Oh and, criticism on the template/design is very much appreciated, but go easy! I'm pretty much going one step at a time and adding a few items here and there; it's still very much in development...
Bookmarks