Turn Off Shopping cart sidebox during checkout pages
Want to disguard shopping cart [more] sidebox on the checkout process on 3 pages.
includes > modules > my template > shopping_cart.php
Where do I place code? using 1.3.7 zen-cart
Example, I am playing with.
Works perfect on the checkout process, but the sidebox Shopping Cart [more] opens on the main page after log out, and when you empty your cart still appears... Don't want this....
What am I missing???
$show_shopping_cart_box = true;
if ($_GET['main_page'] == 'checkout_shipping'){
$show_shopping_cart_box = false;
}
if ($_GET['main_page'] == 'checkout_payment'){
$show_shopping_cart_box = false;
}
if ($_GET['main_page'] == 'checkout_confirmation'){
$show_shopping_cart_box = false; :bangin:
Mark,
Re: Turn Off Shopping cart sidebox during checkout pages
Make sure that all of that is below the existing case statements ...
Re: Turn Off Shopping cart sidebox during checkout pages
There are three case statements in includes > modules < sideboxes > shopping cart. php.
I placed the code just below the following.
case (SHOW_SHOPPING_CART_BOX_STATUS == '2'):
if ( ( ($_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;
}
Yes, you do not see cart on the check out phase, but I still see cart on index page after logging out & empting cart to 0. Should only see cart when product is added to it.
Mark,
Re: Turn Off Shopping cart sidebox during checkout pages
The setting 2 shows when something is in the cart or when there is a GV balance ...
What clicks are you doing and where do you still see this when you think that you should not?
I am assuming your additional code only is setting a false switch and is located beneath the original case statements ...
Re: Turn Off Shopping cart sidebox during checkout pages
includes > modules > sideboxes > your template > shopping_cart.php
I am placing this the code below
$show_shopping_cart_box = true;
if ($_GET['main_page'] == 'checkout_shipping'){
$show_shopping_cart_box = false;
}
if ($_GET['main_page'] == 'checkout_payment'){
$show_shopping_cart_box = false;
}
if ($_GET['main_page'] == 'checkout_confirmation'){
$show_shopping_cart_box = false;
}
Placing this code right above: if ($show_shopping_cart_box == true) between Line 31 & 32 below the case statements.
Yes it works on the checkout phase, but when you empty shopping cart contents to 0, and you click home (index page), products page, log out & log in page the sidebox shopping cart appears saying Your cart is empty.
Normally the shopping cart sidebox never appears on the index page, products page with 0 contents in the cart.
Mark,
Re: Turn Off Shopping cart sidebox during checkout pages
I cannot reproduce this ...
Can you give me an URL and a Click for click break down so that I can repeat this please? :smile:
Re: Turn Off Shopping cart sidebox during checkout pages
Re: Turn Off Shopping cart sidebox during checkout pages
I would like to eliminate the shopping cart sidebox on the 3 checkout phases.
1. checkout_shipping
2. checkout_payment
3. checkout_confirmation
includes > modules > sideboxes > your template > shopping_cart.php
I am placing this the code
<?php
/**
* shopping_cart sidebox - displays contents of customer's shopping cart. Also shows GV balance, if any.
*
* @package templateSystem
* @copyright Copyright 2003-2005 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: shopping_cart.php 3505 2006-04-24 04:00:05Z drbyte $
*/
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 ( ( ($_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;
}
$show_shopping_cart_box = true;
if ($_GET['main_page'] == 'checkout_shipping'){
$show_shopping_cart_box = false;
}
if ($_GET['main_page'] == 'checkout_payment'){
$show_shopping_cart_box = false;
}
if ($_GET['main_page'] == 'checkout_confirmation'){
$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);
}
?>
Placing this code right above: if ($show_shopping_cart_box == true) right below the case statements.
Great works but when you empty your shopping cart or the box still appears on the log in, log out, index page, product pages.
mark,
Re: Turn Off Shopping cart sidebox during checkout pages
This line after the original case statements broke the logic that was originally built in:
PHP Code:
$show_shopping_cart_box = true;
Anything that set the:
$show_shopping_cart_box = false;
is not set now, as you just reset it to true ... then did your new tests ...
Comment out that line ...
Does the logic flow right now for you?
Re: Turn Off Shopping cart sidebox during checkout pages
Thank you for you time fellow Buckeye!
Yes, In the last week I have been studying php and the logic.
Getting a grasp on the language. Still have many miles to run.
It works beautifully.
Mark,