New Zenner
- Join Date:
- Feb 2009
- Posts:
- 23
- Plugin Contributions:
- 0
Post #1 by susan767
I noticed that the best sellers box lists only the items in the category I am currently in.
Instead, I would like it to display a uniform list of best sellers regardless of the category that the customer is in.
Would it be possible to achieve this by changing best_sellers.php as follows?
<?php
$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;
}
if ($show_best_sellers == true) {
$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;
$best_sellers = $db->Execute($best_sellers_query);
if ($best_sellers->RecordCount() >= MIN_DISPLAY_BESTSELLERS) {
$title = BOX_HEADING_BESTSELLERS;
$box_id = 'bestsellers';
$rows = 0;
while (!$best_sellers->EOF) {
$rows++;
$bestsellers_list[$rows]['id'] = $best_sellers->fields['products_id'];
$bestsellers_list[$rows]['name'] = $best_sellers->fields['products_name'];
$best_sellers->MoveNext();
}
$title_link = false;
require($template->get_template_dir('tpl_best_sellers.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_best_sellers.php');
$title = BOX_HEADING_BESTSELLERS;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
}
?>
Thanks,
Susan