Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2007
    Posts
    35
    Plugin Contributions
    0

    Default Bestsellers sidebox not showing all bestsellers all the time

    Is there any way to make the Bestsellers sidebox show all top 10 sellers no matter what page one is viewing? I notice that it shows all top 10 when you're on the main page, but when you're actually in a category it only shows whatever the best seller is for that category, and if you're in a category that doesn't include a bestseller, the sidebox disappears altogether. I'd like the box to show all top 10 all the time - is that possible? Thanks for your help.....

  2. #2
    Join Date
    Feb 2005
    Posts
    104
    Plugin Contributions
    0

    Default Re: Bestsellers sidebox not showing all bestsellers all the time

    I have a worse problem - I only get best sellers in certain categories - and then they are for products that have not yet been sold.

    Go here - http://www.partystore.co.uk/

    no best sellers

    Go here - http://www.partystore.co.uk/index.ph...cPath=100_1941

    best sellers appears but we have no sales for the item that it says is a best seller.

    I have now installed images in best sellers to see if this new module will fix it - but it gives the same results.

    Any ideas - anyone?

    Marc

  3. #3
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

    help question Re: Bestsellers sidebox not showing all bestsellers all the time

    I modified my bestsellers side box and it now shows the top best sellers on the listing pages regardless of category but it is causing an error on the product detail page.

    Fatal error: Call to a member function on a non-object in xxxxx\includes\modules\sideboxes\htd_default\best_sellers.php on line 46
    I deleted lines 33 thru 49 of the module, now the block reads:

    Code:
      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);
        }
    What am I doing wrong, please?

    Thanks!
    Alane

  4. #4
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: Bestsellers sidebox not showing all bestsellers all the time

    OK never mind, I fixed it! Sooo if you want to have the store's best sellers display on all pages, regardless of category you can use this code in your module sideboxes override:

    Code:
    <?php
    /**
     * best_sellers sidebox - displays selected number of (usu top ten) best selling products
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: best_sellers.php 2718 2005-12-28 06:42:39Z drbyte $
     */
    
    // test if box should display
      $show_best_sellers= false;
    
     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);
        }
    ?>

  5. #5
    Join Date
    Jan 2008
    Posts
    35
    Plugin Contributions
    0

    Default Re: Bestsellers sidebox not showing all bestsellers all the time

    Be careful with the above mod - once you make 10 sales it causes a crash

 

 

Similar Threads

  1. Bestsellers on all pages? how?
    By Avalonze in forum General Questions
    Replies: 5
    Last Post: 25 Sep 2008, 06:22 AM
  2. Bestsellers Sidebox on all pages
    By Berserker in forum Basic Configuration
    Replies: 3
    Last Post: 25 Sep 2008, 06:19 AM
  3. Images not showing all the time
    By rternier in forum General Questions
    Replies: 4
    Last Post: 22 Aug 2008, 03:20 PM
  4. HTTPS Not Showing All the Time in Admin
    By Griff1324 in forum General Questions
    Replies: 3
    Last Post: 3 Aug 2008, 10:40 AM
  5. showing all categories(top & sub) in sidebox all the time
    By meocanada in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Mar 2008, 12:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR