Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Remove or Disable Left Column on Login and Checkout Pages

Remove or Disable Left Column on Login and Checkout Pages

Locked

Views: 9,567

Results 1 to 20 of 25
This thread is locked. New replies are disabled.
6 Apr 2009, 9:30 AM
#1
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Remove or Disable Left Column on Login and Checkout Pages

I read recently that the main navigation should be disabled at the checkout pages to minimize 'escape routes'. When I think about it, this makes good sense.

I've been scouring this forum for the answer but cannot seem to find it.

I'd like to disable or remove my left column completely when in the login/account or checkout areas.

Does anyone know how to do this? Is there a simple way to override the global setting?

6 Apr 2009, 9:51 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Remove or Disable Left Column on Login and Checkout Pages

I'd like to disable or remove my left column completely when in the login/account or checkout areas.

Does anyone know how to do this? Is there a simple way to override the global setting?
Overrides are a versatile tool

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

6 Apr 2009, 11:20 AM
#3
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

Hi Kobra,

I read that thread and as Clyde suggested, I added this:

  if (in_array($current_page_base,explode(",",'login,checkout_shipping,checkout_payment,checkout_confirmation,checkout_success')) ) {
  $show_blank_sidebox = false;
  }

to my /includes/modules/sideboxes/blank_sidebox.php

When I enter a checkout page, login page, etc., it has had no effect? I can still see the left column :-(

6 Apr 2009, 1:32 PM
#4
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

OK, solved this a different way. Just add the following to /includes/templates/OVERRIDES/common/tpl_main_page.php

  if (in_array($current_page_base,explode(",",'login,checkout,shopping_cart')) ) {
  $flag_disable_left = true;
  }
6 Apr 2009, 4:06 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Remove or Disable Left Column on Login and Checkout Pages

OK, solved this a different way. Just add the following to /includes/templates/OVERRIDES/common/tpl_main_page.php
I had not actually read closely what Clyde had posted...but the above is outlined in the tpl_main_page.php....
If only supressing columns it is the slicker solution....If interested in displaying alternative layout, info, header, footer - the override solution allows this

6 Apr 2009, 4:34 PM
#6
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

Well, managed to solve it anyway, so it's looking good....

Just one thing bothering me now, how do I remove banners from main_page=shopping_cart ? I've disable banners from my SSL pages, but this is not an SSL page.

6 Apr 2009, 4:48 PM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Remove or Disable Left Column on Login and Checkout Pages

limelites:

Just one thing bothering me now, how do I remove banners from main_page=shopping_cart ? I've disable banners from my SSL pages, but this is not an SSL page.
KoBra:

If interested in displaying alternative layout, info, header, footer - the override solution allows this
Well you would backout what you have done and edit the tpl_main_page.php file commenting or deleting the banner call/code and use this tpl for your checkout process pages via the override system as outlined in the other thread
Or just for the shoping cart page??

6 Apr 2009, 6:29 PM
#8
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

Yeah, just for the shopping cart page as this is not SSL whereas all the other checkout and login pages are.

It might actually be simpler if I could figure out how to make the shopping cart page SSL as that'd take care of it too?

7 Apr 2009, 9:03 AM
#9
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

OK, getting there now. Just one more thing though.

I've disabled left column on the main shopping cart page, the login page, the checkout pages and it's all looking good. However, is there a way to enable the left column on the "your cart is empty" page that you're taken to when you delete an item from the cart?

8 Apr 2009, 9:29 AM
#10
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

I managed to solve this in another way, detailed here.

However, s_t_e_v_e has also provided a very useful solution (untested) which corrects the wrong coding I was using avove:

tpl_main_page.php:

  if (in_array($current_page_base,explode(",",'login,checkout,account,create_account')) ) {
  $flag_disable_left = true;
  }
  
  if (in_array($current_page_base,explode(",",'login,account')) ) {
  $flag_disable_footer = true;
  }
  
  if (in_array($current_page_base,explode(",",'login')) ) {
  $flag_disable_header = true;
  }
  
  if ($current_page_base == 'shopping_cart' && $_SESSION['cart']->count_contents() > 0 ) {
    $flag_disable_left = true;
  }  

Knowing s_t_e_v_e this is 99.999999999999999999% sure to work. However, needs testing.

8 Apr 2009, 10:06 AM
#11
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

Yep, it works... The left column will show when the last item in the shopping cart is removed.

tpl_main_page.php

  if ($current_page_base == 'shopping_cart' && $_SESSION['cart']->count_contents() > 0 ) {
    $flag_disable_left = true;
  } 
8 Apr 2009, 10:16 AM
#12
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

s_t_e_v_e:

Yep, it works... The left column will show when the last item in the shopping cart is removed.

tpl_main_page.php

if ($current_page_base == 'shopping_cart' && $_SESSION['cart']->count_contents() > 0 ) {
$flag_disable_left = true;
}


Steve, I've never seen a reply from you that didn't work, they always do :-)
8 Apr 2009, 3:46 PM
#13
need_help avatar

need_help

Zen Follower

Join Date:
Feb 2009
Posts:
205
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

Those are good tips.

I have the contact Us and EZ pages and checkout now configured to only show the right side of the page.

I also have the product information page only showing the right side of the page.

I want to only show the right side when product categories is also clicked. I'm finding this part harder to do.

I thought it would be as simple as taking a file like below.

if (in_array($current_page_base,explode(",",'product_info,reviews,')) ) {
$flag_disable_left = true;

I thought i could just put the numbers in the file in place of product_info i could put 1 and 1_2 for whatever category i didn't want the left side box showing but it's not working that way.

Anyone know how i can disable the left side when a category is clicked ( to show sub categories ) or to show category images and info. I really don't want the left side showing as i'm trying to get database queries down to a minimum.

I obviously want to keep the left and right side though for the main page.

8 Apr 2009, 3:52 PM
#14
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

Try something like this:

  if ($current_category_id == 1 or $current_category_id == 2 or $current_category_id == 3 or $current_category_id == 4 or $current_category_id == 5 or $current_category_id == 6 ) {

$flag_disable_left = true;

Not sure if that'll work, but that's what I'd try... Change category ID's to suit your own of course.... Let me know...

8 Apr 2009, 7:10 PM
#15
need_help avatar

need_help

Zen Follower

Join Date:
Feb 2009
Posts:
205
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

limelites:

Try something like this:

if ($current_category_id == 1 or $current_category_id == 2 or $current_category_id == 3 or $current_category_id == 4 or $current_category_id == 5 or $current_category_id == 6 ) {

$flag_disable_left = true;

> 
> Not sure if that'll work, but that's what I'd try...  Change category ID's to suit your own of course....  Let me know...

I need to configure the numbers for each category ID but from what i just tested i think it'll work.

Thanks for taking the time to offer help it's appreciated.
8 Apr 2009, 7:22 PM
#16
need_help avatar

need_help

Zen Follower

Join Date:
Feb 2009
Posts:
205
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

I typed too soon.

This is difficult ( for me )

Unfortunately when i just have numbers such as 1 2 or 3 it actually works in erasing the left side but the sub categories vanish and can't be selected anymore.

I tried putting my own numbers in but i just get a blank page for the whole site.

These are the ID numbers i have been trying to get the left side disabled for when you click into them.

1_4

1_2

1_5

1_7

1_99

118_119
118_121
118_128
118_122
118_123
118_127
118_120
10_131_100
10_131_101

I'm sure it's just a simple error i am doing but i'll be darned if i can find it.

8 Apr 2009, 7:22 PM
#17
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

try this:

  if ($current_category_id == 1 or $current_category_id == 4 or $current_category_id == 2 or $current_category_id == 5 or $current_category_id == 7 or $current_category_id == 99 or $current_category_id == 119 or $current_category_id == 121 or $current_category_id == 128 or $current_category_id == 122 or $current_category_id == 123 or $current_category_id == 127 or $current_category_id == 120 or $current_category_id == 100 or $current_category_id == 101) {

$flag_disable_left = true;  

But now I'm not sure what you need... how could the sub-categories ever be selectable if the left column is disabled?

Is it the column you want disabled or is it just a specific sidebox?

8 Apr 2009, 7:29 PM
#18
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

BTW, there are some good tutorials if you search the forums tutorials listed here:

https://www.zen-cart.com/tutorials/index.php

8 Apr 2009, 7:45 PM
#19
need_help avatar

need_help

Zen Follower

Join Date:
Feb 2009
Posts:
205
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

limelites:

try this:

if ($current_category_id == 1 or $current_category_id == 4 or $current_category_id == 2 or $current_category_id == 5 or $current_category_id == 7 or $current_category_id == 99 or $current_category_id == 119 or $current_category_id == 121 or $current_category_id == 128 or $current_category_id == 122 or $current_category_id == 123 or $current_category_id == 127 or $current_category_id == 120 or $current_category_id == 100 or $current_category_id == 101) {

$flag_disable_left = true;

> 
> But now I'm not sure what you need... how could the sub-categories ever be selectable if the left column is disabled?
> 
> Is it the column you want disabled or is it just a specific sidebox?

The category box for your products can be switched to left or right.

You click a category and you get your subcategories now on the subcategories page you get your list i have mine set to 5 items a page and i wish the left sideboxes disabled.
9 Apr 2009, 8:20 AM
#20
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Remove or Disable Left Column on Login and Checkout Pages

I'm pretty sure this should work then:

   if ($current_category_id == 1 or $current_category_id == 4 or $current_category_id == 2 or $current_category_id == 5 or $current_category_id == 7 or $current_category_id == 99 or $current_category_id == 119 or $current_category_id == 121 or $current_category_id == 128 or $current_category_id == 122 or $current_category_id == 123 or $current_category_id == 127 or $current_category_id == 120 or $current_category_id == 100 or $current_category_id == 101) {

$flag_disable_left = true;  

Basically, as soon as you browse to any of the sub categories above, your left sidebox would disable.