Thread: Best seller mod

Results 1 to 3 of 3
  1. #1

    Default Best seller mod

    The folks that designed my site designed this mod, but it doesn't seem to be working correctly.
    The Japanese Product Electronics category is showing up, but how do I get
    Anime Merchandise, Books Japanese, Electronic Media, and Japanese Magazine
    to show up as well?


    http://www.books-japan-online.com/te...t_sellers.html


    This is the code:

    <?php
    /**
    * tpl_page_2_default.php
    *
    * @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: tpl_page_2_default.php 3464 2006-04-19 00:07:26Z ajeh $
    */
    ?>
    <div class="centerColumn" id="pageTwo">
    <h1 id="pageTwoHeading"><?php echo HEADING_TITLE; ?></h1>

    <div id="pageTwoMainContent" class="content">
    <?php
    /**
    * load the html_define for the page_2 default
    */
    require($define_page);
    ?>
    <?php
    $best_id = '8';
    $best_sellers_category = "select categories_name from ". TABLE_CATEGORIES_DESCRIPTION ." where categories_id = '" . $best_id . "' and language_id = '" . (int)$_SESSION['languages_id'] . "'";

    $best_category = $db->Execute($best_sellers_category);
    $best_category_id = $best_category->fields['categories_name'];
    echo '<BR /><BR /><b>' . $best_category_id . '</b><br /><br />';

    $best_sellers_query2 = "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 '". $best_id ."' in (c.categories_id, c.parent_id)
    order by p.products_ordered desc, pd.products_name
    limit 10";

    $best_sellers2 = $db->Execute($best_sellers_query2);
    $rows = 0;
    while (!$best_sellers2->EOF) {
    $rows++;
    $bestsellers_list2[$rows]['id'] = $best_sellers2->fields['products_id'];
    $bestsellers_list2[$rows]['name'] = $best_sellers2->fields['products_name'];
    $best_sellers2->MoveNext();
    }
    for ($i=1; $i<=sizeof($bestsellers_list2); $i++) {
    echo $content2 = $i . '.&nbsp;<a href="' . zen_href_link(zen_get_info_page($bestsellers_list2[$i]['id']), 'products_id=' . $bestsellers_list2[$i]['id']) . '">' . zen_trunc_string($bestsellers_list2[$i]['name'], '200', '...') . '</a><br />';
    }
    ?>
    <br /><br />
    </div>

    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
    </div>
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

  2. #2

    Default Re: Best seller mod

    I was messing around with the mod and I figured something out the best seller list responds to the category id list. The categories are as follows:

    11 Anime Merchandise

    4 Books Japanese

    135 Electronic Media

    7 Japanese Magazines

    8 Japanese Product Electronics

    I copied the php section of the tpl_best_sellers_default.php and just deplicated it but changed $best_id = '11'
    and got the category to show up, but I am also getting japanese elctronic showing up. How do I get products only from that category to show up?

    http://www.books-japan-online.com/te...t_sellers.html
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

  3. #3

    Default Re: Best seller mod

    Can anyone give me advice on what I should do?
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

 

 

Similar Threads

  1. v150 Best seller items...
    By rainbow_pixie_star in forum General Questions
    Replies: 8
    Last Post: 26 Apr 2013, 06:18 PM
  2. v139h Best Seller Question
    By traytray in forum Customization from the Admin
    Replies: 0
    Last Post: 6 Jan 2013, 07:10 AM
  3. Problem with Best Seller Page mod by yellow1912
    By Rasyr in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 29 Nov 2007, 01:25 AM
  4. Best Seller by month
    By frostyy in forum Basic Configuration
    Replies: 0
    Last Post: 20 Apr 2007, 11:06 PM

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