VirtueMart Forum

VirtueMart 2 + 3 => Templating & Layouts => Topic started by: DaggaTora on August 14, 2012, 10:02:59 am

Title: [SOLVED] Show "Last product!" when there is only 1 product in stock
Post by: DaggaTora on August 14, 2012, 10:02:59 am
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!
Title: Re: Show "Last product!" when there is only 1 product in stock
Post by: bytelord 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    }?>
Title: Re: Show "Last product!" when there is only 1 product in stock
Post by: DaggaTora on August 14, 2012, 16:03:59 pm
Thanks!!

it works perfectly!!  ;D
Title: Re: [SOLVED] Show "Last product!" when there is only 1 product in stock
Post by: bytelord on August 14, 2012, 18:24:36 pm
You are welcome. Glad it helps! :)