Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

If 1 write item else write items


Recommended Posts

At the moment it says you have: 0 items in the shopping cart if you haven't added anything if you add one item you get: 1 items and 2 items and so on..


anyways I don't want it to say 1 items I want it to say 1 item (without the s) But I cant get it to work look at my shopping_cart.php code:


<!-- shopping_cart //-->


<td width="210" height="0" id="shopping_cart" align="right" valign="bottom"> <p style="font-weight:bold; font-size:13px; padding-top:0px; padding-bottom:0px;"><div id="product">You have: <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART) ?>"><?=$cart->count_contents()?> items</a></div>

<?php echo tep_draw_separator('pixel_trans.gif', '10', '10'); ?></td>

<!-- shopping_cart_eof //-->


I need to change the red code to something that will display what I just said :)


Edit: As you can see I dont want it in a infobox because I wanna have the text on my header.

Link to comment
Share on other sites

you will need something along the lines of:


if ($cart->count_contents() == 1) {
echo 'item';
} else {
echo 'items';

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...