Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Show bestsellers only on main page

Show bestsellers only on main page

Locked

Views: 1,493

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
13 May 2007, 11:54 AM
#1
knightcat avatar

knightcat

New Zenner

Join Date:
May 2007
Posts:
6
Plugin Contributions:
0

Show bestsellers only on main page

I'm sorry if this has been asked before, but how do I make the bestseller sidebox show on just the main page?
In other words, disable it on all other pages except the main page?
Thanks in advance!

13 May 2007, 12:52 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Show bestsellers only on main page

edit /includes/modules/sideboxes/YOURTEMPLATE/best_sellers.php

in this code block:```
// 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;
}

if ($show_best_sellers == true) {
add the following:
if ($this_is_home_page == false) $show_best_sellers = false;
like this:
// 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;
}

[B] if ($this_is_home_page == false) $show_best_sellers = false;
[/B]
if ($show_best_sellers == true) {

13 May 2007, 1:48 PM
#3
knightcat avatar

knightcat

New Zenner

Join Date:
May 2007
Posts:
6
Plugin Contributions:
0

Re: Show bestsellers only on main page

It works fine. Thanks a lot!