Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2008
    Posts
    101
    Plugin Contributions
    0

    Default 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):

    Code:
    <?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

  2. #2
    Join Date
    Jun 2003
    Posts
    33,720
    Plugin Contributions
    0

    Default 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.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

 

 

Similar Threads

  1. Changing update cart and delete button in shopping cart to text.
    By k1ra in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Mar 2014, 10:52 PM
  2. Changing colour or text in shopping cart box on home page
    By Sushigal in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 Jul 2011, 04:47 PM
  3. Replies: 7
    Last Post: 15 Jun 2010, 06:30 PM
  4. Wanting to create alternate Login text if Shopping Cart is empty
    By alexwoolfson in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 14 Nov 2008, 10:24 AM
  5. Changing shopping cart text
    By bswinnerton in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 30 Jul 2008, 06:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg