Forums / Basic Configuration / Turn Off All sideboxes except shopping cart sidebox during checkout pages

Turn Off All sideboxes except shopping cart sidebox during checkout pages

Locked

Started by dharma on 9 Feb 2007, 11:56 PM · Views: 38,234

Results 1 to 20 of 25
This thread is locked. New replies are disabled.
9 Feb 2007, 11:56 PM
#1
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Turn Off All sideboxes except shopping cart sidebox during checkout pages

I use 8 sideboxes sitewide, but wanted to turn off all of them except the shopping cart sidebox during the following checkout pages:

login page
checkout shipping page
checkout payment page
checkout confirmation page

to turn off:

sideboxes/search_header.php
sideboxes/categories.php
sideboxes/manufacturers.php
sideboxes/whats_new.php
sideboxes/featured.php
sideboxes/specials.php
sideboxes/currencies.php

I have found this link with code to turn off one sidebox on the main page, but am unsure how to do the same thing for so many pages and sideboxes.

As the code I assume must be different for each sidebox, I am not sure what code to use or even what to call the pages in code example:

// test if box should display
$show_whats_new= true;
$this_is_checkout_shipping_page? = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['?manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = checkout_shipping_page?;

http://www.zen-cart.com/forum/showthread.php?t=50606

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

9 Feb 2007, 11:59 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Do these cover a whole column or a mix of both columns?

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!

10 Feb 2007, 12:04 AM
#3
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

I only have sideboxes on the left and have my globals off on the right..what a pain, I know

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

10 Feb 2007, 12:48 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

You could do a customization to the module:
/includes/modules/column_left.php

Copy that to your overrides directory:
/includes/modules/your_template_dir/column_left.php

And then use an IF to skip what you do not want to see on those pages for those sideboxes ...

Example:

if (in_array($current_page_base,explode(",",'login,checkout_shipping,checkout_payment,checkout_confirmation')) && in_array($column_left_display->fields['layout_box_name'],explode(",",'search_header.php,categories.php,manufacturers.php,whats_new.php,featured.php,specials.php,currencies.php')) ) {
// don't do stuff
} else {

Then close that just before the MoveNext ...

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!

10 Feb 2007, 1:12 AM
#5
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Hi!

I moved column_left.php to my override folder and added your code before movenext, but I think I did it incorrectly as my site is not displaying.

here is what I have:

require(DIR_WS_MODULES . 'sideboxes/' . $column_left_display->fields['layout_box_name']);
}
} // file_exists
if (in_array($current_page_base,explode(",",'login,checkout_shipping,checkout_payment,checkout_confirmation')) && in_array($column_left_display->fields['layout_box_name'],explode(",",'search_header.php,categories.php,manufacturers.php,whats_new.php,featured.php,specials.php,currencies.php')) ) {
// don't do stuff
} else {
$column_left_display->MoveNext();
} // while column_left
$box_id = '';
?>

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

10 Feb 2007, 1:15 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Yep did it real wrong ... delete that override ...

Take 2 ...

This is where that fits in:

while (!$column_left_display->EOF and $box_cnt < 100) {
  if (in_array($current_page_base,explode(",",'login,checkout_shipping,checkout_payment,checkout_confirmation')) && in_array($column_left_display->fields['layout_box_name'],explode(",",'search_header.php,categories.php,manufacturers.php,whats_new.php,featured.php,specials.php,currencies.php')) ) {
    // don't show anything
    //echo 'base ' . $current_page_base . ' vs ' . $column_left_display->fields['layout_box_name'] . '<br>';
  } else {
  $box_cnt++;

Then just before the MoveNext:

  } // file_exists
 } // skip sidebox on pages
  $column_left_display->MoveNext();

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!

10 Feb 2007, 1:47 AM
#7
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Wow!

That worked perfectly Thank You!!!!!!!!!!!
:clap:

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

10 Feb 2007, 1:48 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

You owe me now ... :smartass:

Glad to hear that this worked for you ... thanks for the update! :smile:

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!

10 Feb 2007, 1:52 AM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

You may wish to check the array for the pages to also include the change of address files as well ...

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!

10 Feb 2007, 2:01 AM
#10
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Holy Smokes! I forgot about that one! do I add in something to the code?

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

10 Feb 2007, 2:04 AM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

If you look at that evil peice of code I gave you, you will notice that one list of the array has the page names and the other list has the sideboxes ...

Just add ... comma separate, without spaces, the additional pages you want those sideboxes skipped on ... :smile:

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!

10 Feb 2007, 3:36 AM
#12
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Just added the additional page to your evil script, works perfectly!

Thank you again!
:rolleyes:

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

10 Feb 2007, 3:38 AM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

You are most welcome ... glad that this could work for you ... :smile:

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!

11 Feb 2007, 3:35 PM
#14
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Oh! One last thing, Everything works great, however if someone wants to just log in (has no shopping cart) there is a empty sidebox frame in the left column (see jpeg)

Is there a way to get rid of this sidebox leftover? I have tried with my limited knowledge and the style sheet, but cant seem to get rid of it..

any suggestions?

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

11 Feb 2007, 3:37 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

I think I need to see your site to get a clue here ...

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!

11 Feb 2007, 3:48 PM
#16
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

You would need to customize for your template the file:
/includes/templates/your_template_dir/common/tpl_main_page.php

Read through the file ... there is a similar array in there for when to turn off the left column ...

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!

11 Feb 2007, 3:49 PM
#17
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Note: created an account lately? :unsure:

Do you want the sideboxes then?

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!

11 Feb 2007, 4:00 PM
#18
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Whoops!

I guess I need to add those pages to the list of no sideboxes except shopping cart.: if (in_array($current_page_base,explode(",",'login,checkout_shipping,checkout_payment,checkout_confirmation')

Regarding the side box leftover, reading the tpl_main_page it looks like this is what I would add for the login, and now new account pages:

if ($current_page_base == 'login' and $cPath == '') {<br />
$flag_disable_left = true;<br />
}<br />

But wont this disable the left column completely during those pages? (no shopping cart)

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

11 Feb 2007, 4:06 PM
#19
ajeh avatar

ajeh

Oba-san

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

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Well ... yes ... pretty much kills that puppy right off ... :eek:

But you can also use this file to alter the criteria such as check to see if the cart is empty ... if empty kill it ... if not, show it ...

This is a handy dandy little variable:
$_SESSION['cart']->count_contents()

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!

11 Feb 2007, 4:13 PM
#20
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: Turn Off All sideboxes except shopping cart sidebox during checkout pages

Not sure, what code/page I would add this variable to

$_SESSION['cart']->count_contents()

would it be added to the code from page one :
/includes/modules/your_template_dir/column_left.php

or on the main page:
/includes/templates/your_template_dir/common/tpl_main_page.php

with the code above?

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41