Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Sidebox on Checkout Pages Only

Sidebox on Checkout Pages Only

Locked

Views: 845

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
18 Jan 2010, 20:31
#1
designbloke avatar

designbloke

New Zenner

Join Date:
Dec 2009
Location:
Louisiana
Posts:
7
Plugin Contributions:
0

Sidebox on Checkout Pages Only

I created an new override sidebox using the method found here:
https://www.zen-cart.com/tutorials/index.php?article=270

I was able to easily create my sidebox and have it display on the index page only. However, my goal is to post my security validation banner on my log in & checkout pages only.

I cannot figure out how to verify if the checkout page is the current page. I basically want to say " if ($this_is_login_page) then display box" - but with something that works. My code:

if ($this_is_home_page) 
	{ $show_security= true; }
else { $show_security = false;
}		

if ($show_security == true) {
echo' Security Banner Code Inserted Here ';
}
?>
18 Jan 2010, 23:34
#2
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Sidebox on Checkout Pages Only

DesignBloke:

I created an new override sidebox using the method found here:
https://www.zen-cart.com/tutorials/index.php?article=270

I was able to easily create my sidebox and have it display on the index page only. However, my goal is to post my security validation banner on my log in & checkout pages only.

I cannot figure out how to verify if the checkout page is the current page. I basically want to say " if ($this_is_login_page) then display box" - but with something that works. My code:

if ($this_is_home_page)
{ $show_security= true; }
else { $show_security = false;
}

if ($show_security == true) {
echo' Security Banner Code Inserted Here ';
}
?>

try this:

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

19 Jan 2010, 14:54
#3
designbloke avatar

designbloke

New Zenner

Join Date:
Dec 2009
Location:
Louisiana
Posts:
7
Plugin Contributions:
0

Re: Sidebox on Checkout Pages Only

Thanks Clyde. That did the trick. A note to anyone with the same isue. Make sure to add a single quote ( ' ) before the word login. Otherwise it will not work and for me it disabled other working sideboxes. Final code:

<?php // test if box should display if (in_array($current_page_base,explode(",",'login,checkout_shipping,checkout_payment,checkout_confirmation,checkout_success')) ) { $show_security = true; } else { $show_security = false; } if ($show_security == true) { echo'Insert Security Verification Code Here Between Single Quotes'; } ?>