Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Apr 2012
    Location
    beijing
    Posts
    252
    Plugin Contributions
    1

    Default make "specials" module and "bestsellers" module always display

    how to make "specials" module and "bestsellers" module always display at the left or right side?
    when I go to product page,they auto disappear,
    focus on the open source for online shoping website.
    my site: best shop 24h.com

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,359
    Plugin Contributions
    6

    Default Re: how to make "specials" module and "bestsellers" module always display

    Specials is designed to turn off when there is a products_id in the URL ...

    You can change this with your templates and overrides by copying the:
    /includes/modules/sideboxes/specials.php

    to your templates and overrides directory:
    /includes/modules/sideboxes/your_templates_dir/specials.php

    and adding the code in RED:
    Code:
      if (isset($_GET['products_id'])) {
        $show_specials= false;
      } else {
        $show_specials= true;
      }
    
    // bof: force specials to always show
      $show_specials= true;
    // eof: force specials to always show
    
      if ($show_specials == true) {
    For the Best Sellers sidebox you can customize it similarly with the code in RED:
    Code:
      } else {
        $show_best_sellers= true;
      }
    
    // bof: force best_sellers to always show
        $show_best_sellers= true;
    // eof: force best_sellers to always show
    
      if ($show_best_sellers == true) {
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Apr 2012
    Location
    beijing
    Posts
    252
    Plugin Contributions
    1

    Default Re: how to make "specials" module and "bestsellers" module always display

    thanks so much for " Ajeh",it works!
    focus on the open source for online shoping website.
    my site: best shop 24h.com

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,359
    Plugin Contributions
    6

    Default Re: how to make "specials" module and "bestsellers" module always display

    You are most welcome ... thanks for the update that this worked for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,036
    Plugin Contributions
    33

    Default Re: how to make "specials" module and "bestsellers" module always display

    Quote Originally Posted by Ajeh View Post
    You are most welcome ... thanks for the update that this worked for you ...
    This is awesome and is pretty close to what it was I wanted to do. The best sellers sidebox displays on most pages, and it looks like it displays best seller in the product category I am viewing.. (which is very cool) However, if there are no bestsellers in a particular product category, the best sellers sidebox won't display.. In the case where the category being viewed has no best sellers, how would I modify this so that it displays ALL the store best sellers??
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,359
    Plugin Contributions
    6

    Default Re: how to make "specials" module and "bestsellers" module always display

    The top of the IF is being used when there is a category set based on the value of:
    $current_category_id

    If that isn't set, then the bottom half of the IF is used ...

    What you want to do is after the $sql is run the add this IF below it to test if anything was found, and if not, run a copy of the same select that would be run had there been no $current_category_id defined with:
    Code:
      if ($best_sellers->RecordCount () == 0) {
          $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;
      }
    You should be able to add that just above the:
    Code:
    } else {
    see if that gets what you are looking for ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,036
    Plugin Contributions
    33

    Default Re: how to make "specials" module and "bestsellers" module always display

    So this fixed the page I was looking at (product info page), but didn't work here:
    http://eitestsite(dot)eyeitalia(dot)...=index&cPath=5

    but the three subcategories of this are working as expected:
    http://eitestsite(dot)eyeitalia(dot)...dex&cPath=5_10
    http://eitestsite(dot)eyeitalia(dot)...dex&cPath=5_12
    http://eitestsite(dot)eyeitalia(dot)...dex&cPath=5_13

    and just to be clear here's the changes to my best sellers code:
    Code:
    // 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;
      }
    
    // bof: force best_sellers to always show
        $show_best_sellers= true;
    // eof: force best_sellers to always show
    
      if ($show_best_sellers == true) {
        $limit = (trim(MAX_DISPLAY_BESTSELLERS) == "") ? "" : " LIMIT " . (int)MAX_DISPLAY_BESTSELLERS;
          if (isset($current_category_id) && ($current_category_id > 0)) {
          $best_sellers_query = "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 '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id)
                                 order by p.products_ordered desc, pd.products_name";
    
          $best_sellers_query .= $limit;
          $best_sellers = $db->Execute($best_sellers_query);
          if ($best_sellers->RecordCount () == 0) {
          $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;
      }
        } else {
          $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";
    Last edited by DivaVocals; 1 Oct 2013 at 07:49 AM.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,359
    Plugin Contributions
    6

    Default Re: how to make "specials" module and "bestsellers" module always display

    Sorry ... I forgot a set ...

    Immediately, after your new select statement for the $sql in RED it would be a good idea to run that $sql ... so add the line:
    Code:
          $best_sellers = $db->Execute($best_sellers_query);
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,036
    Plugin Contributions
    33

    Default Re: how to make "specials" module and "bestsellers" module always display

    Quote Originally Posted by Ajeh View Post
    Sorry ... I forgot a set ...

    Immediately, after your new select statement for the $sql in RED it would be a good idea to run that $sql ... so add the line:
    Code:
          $best_sellers = $db->Execute($best_sellers_query);
    HA! That did the trick!!

    You are soooooooooooo awesome!!!! Gonna add this post to my "Tips & Tricks" folder..

    Thanks Linda.. as usual, you are a doll!!!
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,359
    Plugin Contributions
    6

    Default Re: how to make "specials" module and "bestsellers" module always display

    You are most welcome ... took me a minute to figure out why the simple select didn't work ... silly me ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Why "Best Sellers" linked to "Specials" (sales module?)?
    By Cluelessjt in forum Basic Configuration
    Replies: 1
    Last Post: 29 Aug 2010, 02:54 AM
  2. Display "Best Sellers" like "What's New" or "Specials" lists.
    By jsmooth in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 22 Jun 2010, 12:06 AM
  3. Help with "Add to cart box", a font change and "New Produts Module"...
    By BenhamCollectibles in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 5 Dec 2009, 05:24 PM
  4. Anyone successful make the "Group Pricing (Per Item)" & "MSRP Display" togther?
    By explorer1979 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 12 Dec 2008, 08:37 AM
  5. On Specials - How can I just display "20% off" or "save $x.xx", but not the price
    By candylotus in forum Setting Up Specials and SaleMaker
    Replies: 0
    Last Post: 24 Apr 2008, 12:44 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