Originally Posted by
Woodymon
xsell items show below tabs, so this will just have to do for me. Not really worth expending the extra energy troubleshooting this minor issue.
of course it is. The way it works is like this:
I take the sql query from the xsell_module.php file and set it to a variable. I take the record count of that variable to see if any products actually exist. If the value is greater than 0 then it will create the tab.
So thats a good thing, we know the query is working because it is showing the tab.
PHP Code:
// Cross Sell as tab or not
$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++;
}
That is the exact query that the actual xsell module uses. I just repeated it in my code. So now we know it is finding that something does exist in the database.
The next part of the code does the actual loading of that data.
PHP Code:
// Cross Sell on tabs (content)
if ($bCrossSell_Tab != false) {
echo '<div id="sc'.$a.'" class="tabcontent" style="display:block;">' . "\n";
require($template->get_template_dir('tpl_modules_xsell_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_xsell_products.php');
echo '</div>' . "\n" . '<!--eof CrossSell_Tab-->';
$a++;
}
All this part does is require the xsell template, the same way the normal way without tabs would do. Only difference is that I'm doing it inside <div></div> tags to make it be inside the container.
So If you could give me a copy of your View Source from a browser it would be helpful so I could tell if that part of the code was executed or not. It might be as simple as that.
Bookmarks