Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2010
    Posts
    257
    Plugin Contributions
    0

    Default New Products - Right Sidebar

    How can I leave the New Products - Right Sidebar turned on for the index page, but turned off for all other pages?

    Thanks!!

  2. #2
    Join Date
    Dec 2010
    Posts
    257
    Plugin Contributions
    0

    Default Re: New Products - Right Sidebar

    Actually, the entire right sidebar can probably go, on the secondary pages...not just the New Products. If that helps simplify things. :-)

  3. #3
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

  4. #4
    Join Date
    Dec 2010
    Posts
    257
    Plugin Contributions
    0

    Default Re: New Products - Right Sidebar

    Stevesh, I tried following those instructions, but apparently I'm even more stupid than I thought, because I keep wiping out the entire page. Could you please explain it nice and slow, for this poor php-challenged moron, because I'm just not getting it. :-/

    Sorry!

  5. #5
    Join Date
    Dec 2010
    Posts
    257
    Plugin Contributions
    0

    Default Re: New Products - Right Sidebar

    I've tried again, several times, and I'm just not getting it. Sorry to be so stupid...I know it's probably something that's incredibly easy to those who have more experience...but I really do need step-by-step help here. Thanks.

  6. #6
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: New Products - Right Sidebar

    Here's the code from includes/modules/sideboxes/whats_new.php: Add the red parts.

    <?php
    /**
    * whats_new sidebox - displays a random "new" product
    *
    * @package templateSystem
    * @copyright Copyright 2003-2010 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: whats_new.php 15880 2010-04-11 16:24:30Z wilt $
    */

    if ($this_is_home_page) {
    $show_whatsnew = true;
    } else {
    $show_whatsnew = false;
    }

    if ($show_whatsnew == true) {

    // display limits
    // $display_limit = zen_get_products_new_timelimit();
    $display_limit = zen_get_new_date_range();
    $random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name,
    p.master_categories_id
    from (" . TABLE_PRODUCTS . " p
    left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
    where p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_status = 1 " . $display_limit;

    // $random_whats_new_sidebox_product = zen_random_select($random_whats_new_sidebox_product_query);
    $random_whats_new_sidebox_product = $db->ExecuteRandomMulti($random_whats_new_sidebox_product_query, MAX_RANDOM_SELECT_NEW);

    if ($random_whats_new_sidebox_product->RecordCount() > 0 ) {
    require($template->get_template_dir('tpl_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_whats_new.php');
    $title = BOX_HEADING_WHATS_NEW;
    $title_link = FILENAME_PRODUCTS_NEW;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    } ?>

    Don't forget the stuff at the bottom, and save it to includes/modules/sideboxes/YOUR_CUSTOM_TEMPLATE_NAME.
    Last edited by stevesh; 23 Sep 2013 at 05:30 PM.

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: New Products - Right Sidebar

    The instructions stevesh linked to are not relevant for turning onn/off the whole sidebar. For that, you need one simple edit to /includes/templates/your_template/common/tpl_main_page.php (copy it from /template_default/ if you don't already have a custom copy).

    There are instructions in the comments at the top of the file, but I will summarize:
    Add a line near the top of the file (after the comments) and inside existing <?php .... ?> tags, like
    PHP Code:
    if (!$this_is_home_page) {
      
    $flag_disable_right true//turn off right column except on homepage

    You can put it below this part:
    PHP Code:
    // the following IF statement can be duplicated/modified as needed to set additional flags
      
    if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
        
    $flag_disable_right true;
      } 

  8. #8
    Join Date
    Dec 2010
    Posts
    257
    Plugin Contributions
    0

    Default Re: New Products - Right Sidebar

    Now that's what I call timing! LOL I was just about to respond to stevesh's post telling him that it worked...but..............

    So I changed the tpl_main_page.php file per your instructions, and now it works perfectly.

    Thank you both!!!!!

 

 

Similar Threads

  1. v154 New Products Sidebar
    By DK_Scully in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Jan 2016, 09:50 PM
  2. Problem with Sidebar and New Products Module
    By Rali in forum General Questions
    Replies: 0
    Last Post: 30 Oct 2009, 04:21 PM
  3. Recommended products Module on right SideBAr
    By dudhi in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 May 2008, 11:28 AM
  4. How to turn off the New Products sidebar?
    By ncmx1 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 9 Feb 2008, 05:53 PM
  5. How to hide 'New Products' link in sidebar?
    By Picci in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Apr 2007, 01:37 PM

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