Author Topic: [SOLVED] Show "Last product!" when there is only 1 product in stock  (Read 1081 times)

DaggaTora

  • Jr. Member
  • **
  • Posts: 253
Hi,

I've been searching though the forum but i can't find the post. I remember a post where someone explains how to show a message on the front end when so clients can know that there is only one product in stock. Something like "Last product in stock!".

Does anyone knows how to achieve this?

Thanks!
Joomla 2.5.17 | VM2.0.26d | PHP 5.3.28

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: Show "Last product!" when there is only 1 product in stock
« Reply #1 on: August 14, 2012, 14:38:45 pm »
Hi,

I have read that here from user PRO. Is for product pages, when a user navigates in product details check the stock and place a message.
http://forum.virtuemart.net/index.php?topic=92756.msg305223#msg305223

you can change the <=10, for example =1 and displays the message "Last product in stock".

for your solution:
Code: [Select]
<?php if ($this->product->product_in_stock ==1) { ?>
                  <div>ONLY <?php echo $this->product->product_in_stock ?> product in Stock. Order now!!</div>
               <?php    }?>
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

DaggaTora

  • Jr. Member
  • **
  • Posts: 253
Re: Show "Last product!" when there is only 1 product in stock
« Reply #2 on: August 14, 2012, 16:03:59 pm »
Thanks!!

it works perfectly!!  ;D
Joomla 2.5.17 | VM2.0.26d | PHP 5.3.28

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: [SOLVED] Show "Last product!" when there is only 1 product in stock
« Reply #3 on: August 14, 2012, 18:24:36 pm »
You are welcome. Glad it helps! :)
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!