Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Bestsellers box question


Guest

Recommended Posts

Posted

How can I have the bestsellers box appear on all pages, but not on the main index?

Posted
How can I have the bestsellers box appear on all pages, but not on the main index?

You just have to change includes/column_left.php to require the box on every page, then create an "if" statement that excludes it from the index page. Hope this helps

Posted
Really need help on this.

 

why not check out code form the current column files? there is a perfect example there ...

 

  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
   include(DIR_WS_BOXES . 'languages.php');
   include(DIR_WS_BOXES . 'currencies.php');
 }

 

as you do not need checkout but index and not languages/currencies but bestsellers, change that

  if (substr(basename($PHP_SELF), 0, 8) != 'index') {
   include(DIR_WS_BOXES . 'bestsellers.php');  }

 

really it was there for you to steal!

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Posted

I just used that code and it gave me all kinds of errors. I just want the bestsellers box to appear anywhere other then the index page.

Posted
why not check out code form the current column files? there is a perfect example there ...

 

 ?if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
? ?include(DIR_WS_BOXES . 'languages.php');
? ?include(DIR_WS_BOXES . 'currencies.php');
?}

 

as you do not need checkout but index and not languages/currencies but bestsellers, change that

 ?if (substr(basename($PHP_SELF), 0, 8) != 'index') {
? ?include(DIR_WS_BOXES . 'bestsellers.php'); ?}

 

really it was there for you to steal!

 

it should probably be

  if (substr(basename($PHP_SELF), 0, 5) != 'index') {
   include(DIR_WS_BOXES . 'bestsellers.php');  }

 

or try

basename($PHP_SELF) != FILENAME_ALL_BRANDS

  if (basename($PHP_SELF) != FILENAME_DEFAULT) {
   include(DIR_WS_BOXES . 'bestsellers.php');  }

 

when you get errors, it's always great to post them here

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Posted

This is my file, where do i put the code? I see the bestsellers box is called for 2 times in the code?

 

<?php

/*

  $Id: column_right.php,v 1.17 2003/06/09 22:06:41 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright © 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

  if (isset($HTTP_GET_VARS['products_id'])) //include(DIR_WS_BOXES . 'manufacturer_info.php');

 

  if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');

 

  if (isset($HTTP_GET_VARS['products_id'])) {

    if (tep_session_is_registered('customer_id')) {

      $check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");

      $check = tep_db_fetch_array($check_query);

      if ($check['count'] > 0) {

        include(DIR_WS_BOXES . 'best_sellers.php');

      } else {

        //include(DIR_WS_BOXES . 'product_notifications.php');

      }

    } else {

      //include(DIR_WS_BOXES . 'product_notifications.php');

    }

  } else {

    include(DIR_WS_BOXES . 'best_sellers.php');

  }

    include(DIR_WS_BOXES . 'specials.php');

    include(DIR_WS_BOXES . 'my_new_box.php');

 

  //require(DIR_WS_BOXES . 'reviews.php');

 

  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

    //include(DIR_WS_BOXES . 'languages.php');

    //include(DIR_WS_BOXES . 'currencies.php');

  }

?>

Posted
This is my file, where do i put the code? I see the bestsellers box is called for 2 times in the code?

 

 

if you want to show the bestsellers box on all pages apart from index, comment out both references to trhe bestsellers box in this file, just like it was done a few lines below with //

 

in column left add this

if (basename($PHP_SELF) != FILENAME_DEFAULT) {
  include(DIR_WS_BOXES . 'best_sellers.php');  }

 

I did not notice this box had an underscore ...

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Posted

It still only appears on one page, not all?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...