PHP Shopping cart status

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dddmx3
Forum Newbie
Posts: 16
Joined: Mon Sep 20, 2010 9:05 pm

PHP Shopping cart status

Post by dddmx3 »

Currently, I have this code that shows you what you have in your shopping cart:
(The code is live, here.)

Code: Select all

<div id = "shopping_cart">
<table width = "100%" >
<tr>
    <td>
    <p><?php print JText::_('CART1')?>&nbsp;<?php print $cart->count_product?>&nbsp;<?php print JText::_('CART2')?>&nbsp;-&nbsp;<a href = "<?php print SEFLink('index.php?option=com_jshopping&controller=cart&task=view', 1)?>"><?php print JText::_('CHECKOUT')?></a></p>
    </td>
</tr>
</table>
</div>
But when your shopping cart is empty, it still shows: You have 0 item(s) in your cart - Checkout?
But I'd like for it to say: Your cart is empty!
In the language file its defined as "EMPTY". Can someone please help? I know theres something like <?php else or idk!
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: PHP Shopping cart status

Post by twinedev »

Just tried the site, and when my cart is empty (both initial visit and after adding something then removing it, it says "Your cart is empty? Oh boy." So I'm assuming you found what you needed?
dddmx3
Forum Newbie
Posts: 16
Joined: Mon Sep 20, 2010 9:05 pm

Re: PHP Shopping cart status

Post by dddmx3 »

Yes. I guess the moderators deleted the other posts?
Post Reply