Author Topic: Display stock leval as text  (Read 1255 times)

beha

  • Beginner
  • *
  • Posts: 1
Display stock leval as text
« on: July 09, 2012, 17:38:03 pm »
Hello, i searched forum, but i cannot find solution on how to display stock level as text on product details. Could you help me with this, i want to get result as: Product on stock (is stock leval is 1 or more) or Out of stock (if stock level is 0)

Virtuemart is version 2.0.8, and set in catalog mode only.


ivus

  • Full Member
  • ***
  • Posts: 534
  • - YAY me... proud member of the 500 club...
Re: Display stock leval as text
« Reply #1 on: July 18, 2012, 12:00:45 pm »
Hi beha,

In your productsdetails.php file try placing this bit of code where you want to display the stock level.

   <?php if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none') && (VmConfig::get ( 'display_stock', 1 )) ) : ?>
        <?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP') .' '. $this->product->product_in_stock - $this->product->product_ordered; ?>
   <?php endif; ?>

I hope this helps.

Genius WebDesign

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 175
    • Genius WebDesign
Re: Display stock leval as text
« Reply #2 on: July 18, 2012, 14:48:16 pm »
Hi beha,

You need to make some PHP if-statements to be able to do so.
You can actually do alot of cool stuff with the stock-info, e.g. place a module to be shown according to different stock levels. You could then make a custom HTML-module for each stock level and have them shown with all the content you want at the right time.

I´ve been working alot in this particular field with my own projects, and I currently offer my work to others who needs coding/styling.

You are always welcome to send me an e-mail, webmaster@traeogbyg.dk, if you want me to take a look at your site