icedoutrolla Posted November 27, 2013 Posted November 27, 2013 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 :)
burt Posted November 27, 2013 Posted November 27, 2013 <?php echo ($product_info['products_quantity'] > 10) ? '10+' : $product_info['products_quantity']; ?>
icedoutrolla Posted December 2, 2013 Author Posted December 2, 2013 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! :)
♥Monika in Germany Posted December 4, 2013 Posted December 4, 2013 <?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 ...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.