Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

If products_quantity is more than x amount, how can I display x+ instead of true quantity?


icedoutrolla

Recommended Posts

Posted

Hi all,

 

I am using <?php echo stripslashes($product_info['products_quantity']); ?> on my product_info.php page.

 

Currently it will display the total quantity for a product.

 

For example, I want it to only display 10+ for anything over 10, for anything less than 10 it should display the product true quantity.

 

Any suggestions?

 

Thank you :)

Posted

Awesome @@burt that works perfectly.

 

Now, I'm thinking to elaborate on this more, would you mind advising a method to state something like "We have 10+ available" and if QTY drops below 10 it would state "Be in quick! We only have X available!"

 

Thank you! :)

Posted
<?php
echo ($product_info['products_quantity'] > 10) ? 'We have 10+ available' : 'Be in quick! We only have ' . $product_info['products_quantity'] . ' available!';
?>

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Archived

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

×
×
  • Create New...