Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Changing Text Based On Whether Shopping Cart Is Empty

Changing Text Based On Whether Shopping Cart Is Empty

Locked

Views: 886

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
11 Nov 2008, 11:36 PM
#1
alexwoolfson avatar

alexwoolfson

Zen Follower

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

Changing Text Based On Whether Shopping Cart Is Empty

I tried posting this in First Steps, but I after several days of no replies, I'm thinking that this board might be the place for this more advanced question.

In short, I want to change some text on my Log In screen based on whether the Shopping Cart is empty or not.

Based on Eric Leuenberger's excellent 20 Ways template pack, I've altered my Login screen to say "New Customer? Please start your checkout here." which, when the Shopping Cart has something in it, makes sense. But when the Shopping Cart is empty, then I'd be afraid it would be confusing for my shoppers, so I want to have some alternate text for when the shopping cart is empty.

I now have that:

define('HEADING_NEW_CUSTOMER', 'New Customer? Please start your checkout here.');
define('HEADING_NEW_CUSTOMER_2', 'New Customer? You can create an account here for faster Checkout.');

And here is how I've altered my tpl_login_default.php file (around line 67):

<?php echo zen_draw_form('create_account', zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onsubmit="return check_form(create_account);"') . zen_draw_hidden_field('action', 'process') . zen_draw_hidden_field('email_pref_html', 'email_format'); ?>
<fieldset>
	  <php?
    if ($_SESSION['cart']->count_contents() > 0) {
<legend><?php echo HEADING_NEW_CUSTOMER; ?></legend>
	} else {
<legend><?php echo HEADING_NEW_CUSTOMER_2; ?></legend>
	}
	  ?>

Unfortunately, I'm getting this:

Can someone point me in the right direciton of making this work? Is it a PHP error? Am I not calling the Shopping Cart correctly?

If someone could help me with this, I would greatly appreciate it.

Thank you,

Alex

12 Nov 2008, 3:12 AM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,606
Plugin Contributions:
0

Re: Changing Text Based On Whether Shopping Cart Is Empty

We do not double post. If you have more details to your original thread you can replay to your own posts.

If you have not gotten an answer it usually means no one has the answer or that the right person hasn't seen it yet.