Forums / Templates, Stylesheets, Page Layout / Hide What's New and Best Sellers Sideboxes

Hide What's New and Best Sellers Sideboxes

Views: 5,103

Results 1 to 20 of 40
24 Jun 2011, 6:33 AM
#1
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Hide What's New and Best Sellers Sideboxes

I want to hide the What's new sidebox and Best Sellers Sidebox on my home page but I still want the column to be there as I want to create image graphics/ads to place in the side box on the right hand side.

Would it be best to code these in, or add sideboxes for banner images?

Thanks a bunch. I am thinking I need to edit the Best_Sellers.php file and Whats_New.php?

24 Jun 2011, 6:53 AM
#2
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Hide What's New and Best Sellers Sideboxes

Turn them off via admin, tools, layout controller.
Images....use Banner Box or install blank sidebox
or logo sidebox mod/s from Free Software Addons...
Link top left of this page

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

24 Jun 2011, 8:16 PM
#3
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Re: Hide What's New and Best Sellers Sideboxes

misty:

Turn them off via admin, tools, layout controller.
Images....use Banner Box or install blank sidebox
or logo sidebox mod/s from Free Software Addons...
Link top left of this page

If I turn them off then they are turned off for every page, I only want them turned off for the home page. How is this done

24 Jun 2011, 10:38 PM
#5
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Re: Hide What's New and Best Sellers Sideboxes

misty:

Scroll down to foot of this page....previous threads asking
similar i.e.
http://www.zen-cart.com/forum/showthread.php?t=52941

Thanks for the reference, but still doesn't seem to do what I am wanting to accomplish. If I do this approach it get's rid of the entire sidebox column. I want the column on the right, just no "Best Seller" & What's New Sideboxs

24 Jun 2011, 11:01 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide What's New and Best Sellers Sideboxes

Using your templates and overrides, customize the best_sellers.php sidebox with the code in red:

// bof: turn off best sellers on home page
if ($this_is_home_page) { 
    $show_best_sellers= false;
}  
// eof: turn off best sellers on home page

  if ($show_best_sellers == true) {

Customize the whats_new.php sidebox with the code in red:

// bof: turn off whats_new on home page
if ($this_is_home_page) { 
    $show_whats_new= false;
} else {
    $show_whats_new= true;
}
// eof: turn off whats_new on home page

// display limits

and then lower in the code:

  if ($show_whats_new && $random_whats_new_sidebox_product->RecordCount() > 0 ) {

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!

25 Jun 2011, 1:10 AM
#7
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Re: Hide What's New and Best Sellers Sideboxes

Ajeh:

Using your templates and overrides, customize the best_sellers.php sidebox with the code in red:

// bof: turn off best sellers on home page
if ($this_is_home_page) {
$show_best_sellers= false;
}
// eof: turn off best sellers on home page

if ($show_best_sellers == true) {

> 
> Customize the whats_new.php sidebox with the code in red:
> ```
// bof: turn off whats_new on home page
if ($this_is_home_page) { 
    $show_whats_new= false;
} else {
    $show_whats_new= true;
}
// eof: turn off whats_new on home page

// display limits

and then lower in the code:

if ($show_whats_new && $random_whats_new_sidebox_product->RecordCount() > 0 ) {


I did as you said, but they are still on? The directory I altered the files in was:

mysite.com/mytemplate/includes/modules/sideboxes/mytemplate/

is this correct?

If I add the code you metioned further down it shuts everything off on all the pages...$show_whats_new && $random_whats_new_sidebox_product->RecordCount() > 0 ) {
25 Jun 2011, 1:17 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide What's New and Best Sellers Sideboxes

If you just do the Best Sellers sidebox ... does that work correctly?

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!

25 Jun 2011, 1:19 AM
#9
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Re: Hide What's New and Best Sellers Sideboxes

I did as you said, but the "whats_new" is still on? The directory I altered the files in was:

mysite.com/mytemplate/includes/modules/sideboxes/mytemplate/

is this correct?

If I add the code you mentioned further down in the "whats_new" file it shuts everything off on all the pages...$show_whats_new && $random_whats_new_sidebox_product->RecordCount() > 0 ) {

25 Jun 2011, 1:20 AM
#10
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Re: Hide What's New and Best Sellers Sideboxes

Ajeh:

If you just do the Best Sellers sidebox ... does that work correctly?

Best Sellers worked fine, just the "what's new" doesn't go off. I tried removing the else {
$show_whats_new= true;

code as that is the only difference in the "best seller" and "what's new" but nada...

25 Jun 2011, 1:24 AM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide What's New and Best Sellers Sideboxes

I don't know where your code is but this:
mysite.com/mytemplate/includes/modules/sideboxes/mytemplate/

is not a valid path ...

you see the:
/your_secret_admin
/download
/images
/includes

Now go to:
/includes/modules/sideboxes

copy the file:
/includes/modules/sideboxes/whats_new.php

to your templates and overrides directory for modules in:
/includes/modules/sideboxes/your_template_dir/whats_new.php

and then add the customizations ...

follow the same method for the best_sellers.php ...

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!

27 Jun 2011, 6:20 PM
#12
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Re: Hide What's New and Best Sellers Sideboxes

Ajeh:

I don't know where your code is but this:
mysite.com/mytemplate/includes/modules/sideboxes/mytemplate/

is not a valid path ...

you see the:
/your_secret_admin
/download
/images
/includes

Now go to:
/includes/modules/sideboxes

copy the file:
/includes/modules/sideboxes/whats_new.php

to your templates and overrides directory for modules in:
/includes/modules/sideboxes/your_template_dir/whats_new.php

and then add the customizations ...

follow the same method for the best_sellers.php ...

I do have the "What's New" and "Best Sellers" sideboxes in my template override folder located here:

mysite.com/includes/modules/sideboxes/mytemplate/

The alterations to "Best Sellers" works fine, but the "What's New" is no good...

27 Jun 2011, 6:31 PM
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide What's New and Best Sellers Sideboxes

Do you see errors or do you just see the What's New on the Home Page? :unsure:

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!

27 Jun 2011, 6:35 PM
#14
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Re: Hide What's New and Best Sellers Sideboxes

Ajeh:

Do you see errors or do you just see the What's New on the Home Page? :unsure:

Just the what's new on the home page :ohmy:

27 Jun 2011, 6:46 PM
#15
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide What's New and Best Sellers Sideboxes

And your file:
/includes/modules/sideboxes/your_template_dir/whats_new.php

looks like:

<?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 $
 */


// bof: turn off whats_new on home page
if ($this_is_home_page) {
    $show_whats_new= false;
} else {
    $show_whats_new= true;
}
// eof: turn off whats_new on home page

// 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 ($show_whats_new && $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);
  }

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!

27 Jun 2011, 6:52 PM
#16
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Re: Hide What's New and Best Sellers Sideboxes

Ajeh:

And your file:
/includes/modules/sideboxes/your_template_dir/whats_new.php

looks like:

<?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 $ */ // bof: turn off whats_new on home page if ($this_is_home_page) { $show_whats_new= false; } else { $show_whats_new= true; } // eof: turn off whats_new on home page // 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 ($show_whats_new && $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); } ``` All the same execpt for the bold section: I have this because I am excluding what's new from the Product ID pages as well. // $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 ($show_whats_new && $random_whats_new_sidebox_product->RecordCount() > 0 ) { } **if (!isset($_GET['products_id']) && $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); }
27 Jun 2011, 9:25 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide What's New and Best Sellers Sideboxes

This code does nothing ...

if ($show_whats_new && $random_whats_new_sidebox_product->RecordCount() > 0 ) {
}

You are trying to do more than first explained ...

First, remove this code:

// bof: turn off whats_new on home page
if ($this_is_home_page) {
    $show_whats_new= false;
} else {
    $show_whats_new= true;
}
// eof: turn off whats_new on home page

Then, change your code in bold to:

if (!this_is_home_page && !isset($_GET['products_id']) && $random_whats_new_sidebox_product->RecordCount() > 0 ) {

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!

27 Jun 2011, 9:36 PM
#18
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Re: Hide What's New and Best Sellers Sideboxes

Perfect that worked! I figured that code did nothing, but I couldn't figure out how to properly set up the code to exclude home page and product ID but what you recommended worked perfect. Thanks.

I want to add Promotional Boxes on the right side of the home page, so should I use banner boxes, or just code in GIF images?

27 Jun 2011, 9:38 PM
#19
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide What's New and Best Sellers Sideboxes

Depends on what all you want to do ...

You could add conditions to the Banner sidebox to limit its use to the Home page in a similar manner ...

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!

27 Jun 2011, 10:05 PM
#20
airsoftoutfitter avatar

airsoftoutfitter

Zen Follower

Join Date:
Dec 2009
Posts:
244
Plugin Contributions:
0

Re: Hide What's New and Best Sellers Sideboxes

Ajeh:

Depends on what all you want to do ...

You could add conditions to the Banner sidebox to limit its use to the Home page in a similar manner ...

Could you mind providing me the code to do so? I am wanting to have about 3-4 promo boxes. Just things that say free shipping on orders, or to highlight a new product, etc.