Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Remove shopping cart sidebox from Account History Page

Remove shopping cart sidebox from Account History Page

Locked

Views: 1,408

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
13 Oct 2010, 1:14 PM
#1
maineiac13 avatar

maineiac13

New Zenner

Join Date:
Sep 2008
Posts:
98
Plugin Contributions:
0

Remove shopping cart sidebox from Account History Page

I want to remove the shopping cart sidebox from the account history page.

I have looked at other threads and in particular this one: http://www.zen-cart.com/forum/showthread.php?t=63813

So following that pattern I wanted to add something like this:

 if ($_GET['main_page'] == 'account_history_info'){
$show_shopping_cart_box = false;
}

However that did not produce any results as the shopping cart side box still appears. Nor did it do anything if I changed to 'account_history' instead of 'account_history_info' nor if I used both statements.

Interestingly, however, if I do the following:

if ($_GET['main_page'] == 'account'){
$show_shopping_cart_box = false;
}

then the shopping cart sidebox disappears when going to the "My Account" link...however, it reappears when I then move to the account history pages...

Any suggestions would be appreciated. Thanks, Ken

Forgot to mention that the file I am talking about modifying is: shopping_cart.php

13 Oct 2010, 1:30 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Remove shopping cart sidebox from Account History Page

You need to include each of the pages where you want that removed ...

if ($_GET['main_page'] == 'account' || $_GET['main_page'] == 'account_history' || $_GET['main_page'] == 'account_history_info'){ 

NOTE: if you want to include the other sections of the My Account area, add them as well ...

13 Oct 2010, 2:02 PM
#3
maineiac13 avatar

maineiac13

New Zenner

Join Date:
Sep 2008
Posts:
98
Plugin Contributions:
0

Re: Remove shopping cart sidebox from Account History Page

Thanks...but maybe I am trying to block the shopping cart from the wrong page.

The page I want the shopping cart blocked from is the page where one views specific order information on a prior order. I thought that would be 'account_history_info' but if it is then for some reason this is still not working even though it works on the main account page and on the show all orders page. But when I click on "view" to see a specific order then the shopping cart sidebox still shows up.

13 Oct 2010, 3:04 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Remove shopping cart sidebox from Account History Page

Make sure that you are adding the new code in the right place ...

If I add the code:

if ($_GET['main_page'] == 'account' || $_GET['main_page'] == 'account_history' || $_GET['main_page'] == 'account_history_info'){
        $show_shopping_cart_box = false;
}

above the existing code:

  if ($show_shopping_cart_box == true) {

I do not see the shopping cart sidebox when on those pages ...

13 Oct 2010, 4:05 PM
#5
maineiac13 avatar

maineiac13

New Zenner

Join Date:
Sep 2008
Posts:
98
Plugin Contributions:
0

Re: Remove shopping cart sidebox from Account History Page

That is where I am adding it... Here is the entire file:

switch (true) {
    case (SHOW_SHOPPING_CART_BOX_STATUS == '0'):
      $show_shopping_cart_box = true;
      break;
    case (SHOW_SHOPPING_CART_BOX_STATUS == '1'):
      if ($_SESSION['cart']->count_contents() > 0 || (isset($_SESSION['customer_id']) && zen_user_has_gv_account($_SESSION['customer_id']) > 0)) {
        $show_shopping_cart_box = true;
      } else {
        $show_shopping_cart_box = false;
      }
      break;
    case (SHOW_SHOPPING_CART_BOX_STATUS == '2'):
      if ( ( (isset($_SESSION['cart']) && $_SESSION['cart']->count_contents() > 0) || (isset($_SESSION['customer_id']) && zen_user_has_gv_account($_SESSION['customer_id']) > 0) ) && ($_GET['main_page'] != FILENAME_SHOPPING_CART) ) {
        $show_shopping_cart_box = true;
      } else {
        $show_shopping_cart_box = false;
      }
      break;
    }

	if ($_GET['main_page'] == 'account' || $_GET['main_page'] == 'account_history' || $_GET['main_page'] == 'account_history_info'){

	
	$show_shopping_cart_box = false;

	
	
	}


  if ($show_shopping_cart_box == true) {
    require($template->get_template_dir('tpl_shopping_cart.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_shopping_cart.php');
    $title =  BOX_HEADING_SHOPPING_CART;
    $title_link = false;
    $title_link = FILENAME_SHOPPING_CART;

    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
  }
?>

I think I need to try to install this in a completely fresh cart and then if it works see what may be causing it not to work in my cart.

13 Oct 2010, 5:32 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Remove shopping cart sidebox from Account History Page

Which file are you updating ... the original or your template and override file in:
/includes/modules/sideboxes/your_template_dir/shopping_cart.php

13 Oct 2010, 6:02 PM
#7
maineiac13 avatar

maineiac13

New Zenner

Join Date:
Sep 2008
Posts:
98
Plugin Contributions:
0

Re: Remove shopping cart sidebox from Account History Page

the override file

13 Oct 2010, 6:04 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Remove shopping cart sidebox from Account History Page

I am not sure why this would not be working for you ... :unsure: