So this fixed the page I was looking at (product info page), but didn't work here:
http://eitestsite(dot)eyeitalia(dot)...=index&cPath=5
but the three subcategories of this are working as expected:
http://eitestsite(dot)eyeitalia(dot)...dex&cPath=5_10
http://eitestsite(dot)eyeitalia(dot)...dex&cPath=5_12
http://eitestsite(dot)eyeitalia(dot)...dex&cPath=5_13
and just to be clear here's the changes to my best sellers code:
Code:
// test if box should display
$show_best_sellers= false;
if (isset($_GET['products_id'])) {
if (isset($_SESSION['customer_id'])) {
$check_query = "select count(*) as count
from " . TABLE_CUSTOMERS_INFO . "
where customers_info_id = '" . (int)$_SESSION['customer_id'] . "'
and global_product_notifications = '1'";
$check = $db->Execute($check_query);
if ($check->fields['count'] > 0) {
$show_best_sellers= true;
}
}
} else {
$show_best_sellers= true;
}
// bof: force best_sellers to always show
$show_best_sellers= true;
// eof: force best_sellers to always show
if ($show_best_sellers == true) {
$limit = (trim(MAX_DISPLAY_BESTSELLERS) == "") ? "" : " LIMIT " . (int)MAX_DISPLAY_BESTSELLERS;
if (isset($current_category_id) && ($current_category_id > 0)) {
$best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
. TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
where p.products_status = '1'
and p.products_ordered > 0
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p.products_id = p2c.products_id
and p2c.categories_id = c.categories_id
and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id)
order by p.products_ordered desc, pd.products_name";
$best_sellers_query .= $limit;
$best_sellers = $db->Execute($best_sellers_query);
if ($best_sellers->RecordCount () == 0) {
$best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_status = '1'
and p.products_ordered > 0
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
order by p.products_ordered desc, pd.products_name
limit " . MAX_DISPLAY_BESTSELLERS;
}
} else {
$best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_status = '1'
and p.products_ordered > 0
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
order by p.products_ordered desc, pd.products_name";