Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2009
    Posts
    617
    Plugin Contributions
    0

    Idea or Suggestion Turn Off Certain Sideboxes on Home Page

    I followed this article from the Tutorials but it still does not seem to be working!

    I just want to turn off the 'Featured Products' and the 'What's New' Sideboxes on my home page.

    Any suggestions? Thanks
    Thank you,
    autoace

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

    Default Re: Turn Off Certain Sideboxes on Home Page

    Using your templates and overrides, copy the two files:
    /includes/modules/sideboxes/featured.php
    /includes/templates/template_default/sidebox/tpl_featured.php

    to your templates and override directories:
    /includes/modules/sideboxes/your_template_dir/featured.php
    /includes/templates/your_template_dir/sidebox/tpl_featured.php

    and customize the file:
    /includes/modules/your_template_dir/sideboxes/featured.php

    Change:
    Code:
    // test if box should display
      $show_featured= true;
    to read:
    Code:
    // test if box should display
      $show_featured= true;
      if ($this_is_home_page) {
    // do not show on home page
        $show_featured= false;
      } else {
    // show if not on home page
        $show_featured= true;
      }
    Using the same method to copy the whats_new sidebox files, change the whole file:
    /includes/modules/sideboxes/your_template_dir/whats_new.php

    to read:
    Code:
    <?php
    /**
     * whats_new sidebox - displays a random "new" product
     *
     * @package templateSystem
     * @copyright Copyright 2003-2007 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 6475 2007-06-08 21:10:33Z ajeh $
     */
    
    // test if box should display
      $show_whats_new= true;
      
      if ($this_is_home_page) {
    // do not show on home page
        $show_whats_new= false;
      } else {
    // show if not on home page
        $show_whats_new= true;
      }
      
      if ($show_whats_new == 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 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);
      }
    }
    ?>
    Last edited by Ajeh; 30 Sep 2009 at 06:07 PM. Reason: fix paths :)
    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!]
    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
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Turn Off Certain Sideboxes on Home Page

    /includes/modules/sideboxes/your_template_dir/featured.php
    /includes/modules/sideboxes/your_template_dir/whats_new.php

  4. #4
    Join Date
    Jun 2009
    Posts
    617
    Plugin Contributions
    0

    Default Re: Turn Off Certain Sideboxes on Home Page

    Linda, thanks for suck a quick reply!

    I did follow your instructions but it still did NOT work

    So I just went to my admin area and turned them off for now. I will trouble shoot a bit later.

    Thanks again for your efforts.
    Thank you,
    autoace

  5. #5
    Join Date
    Jun 2009
    Posts
    617
    Plugin Contributions
    0

    Default Re: Turn Off Certain Sideboxes on Home Page

    Quote Originally Posted by gjh42 View Post
    /includes/modules/sideboxes/your_template_dir/featured.php
    /includes/modules/sideboxes/your_template_dir/whats_new.php
    Thank you very much - it WORKS!
    Thank you,
    autoace

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

    Default Re: Turn Off Certain Sideboxes on Home Page

    Quote Originally Posted by gjh42 View Post
    /includes/modules/sideboxes/your_template_dir/featured.php
    /includes/modules/sideboxes/your_template_dir/whats_new.php
    I was testing you ... yeah ... that's it ... testing you to see if you were paying any attention ...
    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!]
    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!

 

 

Similar Threads

  1. turn off left or right side bar on home page only [and only certain EZ pages]
    By thebigkick in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Jun 2012, 10:23 PM
  2. How to turn off specials and new products on home page?
    By goldnuggetsales.com in forum General Questions
    Replies: 3
    Last Post: 10 Mar 2011, 10:42 PM
  3. Way to turn off bannerbox just on home page?
    By bottyz in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 21 Apr 2010, 01:37 PM
  4. Turn off right column in home page only
    By KiwiBrian in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 23 Jul 2008, 08:18 PM
  5. turn off side columns on home page (code example)
    By kiddo in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 9 Feb 2007, 03:59 AM

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