Author Topic: How to modify the in stock info for product  (Read 97 times)

kostianev

  • Jr. Member
  • **
  • Posts: 55
  • Web Developer
    • MOON.bg
  • Skype Name: moonbgltd
  • VirtueMart Version: 3.x
How to modify the in stock info for product
« on: October 09, 2017, 16:57:36 pm »
Dear, I have custom template and want to integrate the In stock level, but only to show that the product is In stock, I need to hide the quantity.

I use this: <?php echo jtext::_('COM_VIRTUEMART_STOCK_AMOUNT');?>: <?php echo $this->product->product_in_stock; ?>
Now is displaying "In stock: 20" I need only to show the text "In Stock"

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7590
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: How to modify the in stock info for product
« Reply #1 on: October 09, 2017, 23:50:13 pm »
<?php
if($this->product->product_in_stock > 0){
echo JTEXT::_('COM_VIRTUEMART_STOCK_AMOUNT');
}
?>
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

kostianev

  • Jr. Member
  • **
  • Posts: 55
  • Web Developer
    • MOON.bg
  • Skype Name: moonbgltd
  • VirtueMart Version: 3.x
Re: How to modify the in stock info for product
« Reply #2 on: October 10, 2017, 08:22:00 am »
Perfect, this working for me. Can you tell me, if you know - how can I make the code, when the product is not in stock with If / Else function to display other div class with red text Out of stock? Because now I have green div for In Stock level and when is out of stock is displayed in additional without div in red for example?