Author Topic: Current Stock Level Image/Text in VM2  (Read 3795 times)

suchafan

  • Beginner
  • *
  • Posts: 14
Current Stock Level Image/Text in VM2
« on: May 22, 2012, 07:33:16 am »
Joomla: 2.5.4
VirtueMart: 2.0.6
PHP: 5.3.8

I searched in the forum for removing the Stock Level Image/Text entirely from VM2. Here is what I found in the forum to delete, but it did not work:

I went here:
components/com-virtuemart/category/tmpl

I removed this from the default.php file:

<?php
if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none') && (VmConfig::get ( 'display_stock', 1 )) ){?>
<!--if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none')){?> -->
<div class="paddingtop8">
<span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span>
<span class="stock-level"><?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP') ?></span>
</div>
<?php }?>

Afterwards, I still see the Stock level Image/Text on my live product page. Trying to turn off (uncheck) "Display Stock Level" from config/shopfront in Admin has no effect whatsoever. Where do I go to delete all Current Stock Level graphics and Text "Current Stock Level" from showing up on site pages?

Thanks for the help.

suchafan

  • Beginner
  • *
  • Posts: 14
Re: Current Stock Level Image/Text in VM2
« Reply #1 on: May 24, 2012, 05:56:47 am »
Can I please ask a moderator or someone to answer my question? I've searched as best as I could in trying to find an answer in the forum but was not successful in finding a solution for this.

What works to hide the Current Stock Level graphic and text from the front end since the check box in the Shopfront/Config already defaults to off?

Thanks!

P.S. How come there wasn't a red "NEW" symbol for this initial post?

suchafan

  • Beginner
  • *
  • Posts: 14
Re: Current Stock Level Image/Text in VM2
« Reply #2 on: June 05, 2012, 08:22:31 am »
Gee...thanks for your response! It was sure helpful---AND, with a speedy turnaround time!! Hmmm, let's see...it almost makes me want to give you some money for the retail version. I couldn't find anything in your forum that helped me out with this Stock Level problem (not even a human being)

Love ya!!!

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27466
  • Always on vacation
    • Jenkin Hill Internet
Re: Current Stock Level Image/Text in VM2
« Reply #3 on: June 06, 2012, 00:37:52 am »
I moved this to the most likely section.

Firstly for me, ever since wm2.0.6 the switch in VM configuration/Shopfront has always worked to show/remove the stock image & text.

It is correct to remove the following from joomla_root/components/com_virtuemart/views/category/tmpl/default.php

Code: [Select]
<?php
if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none') && (VmConfig::get 'display_stock')) ){?>

<!-- if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none')){?> -->
<div class="paddingtop8">
<span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span>
<span class="stock-level"><?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP'?></span>
</div>
<?php }?>

And then you should use the modified default.php as an override, ie it should be  joomla_root/templates/your_template/html/com_virtuemart/category/default.php

Both methods work for me.

Moderators are not here just to answer questions, although we do when we have spare time. It may help to read this : http://forum.virtuemart.net/index.php?topic=68489.0
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.3.10057 on Joomla 3.9.10 PHP 7.0.33
Testing VM 3.5.0.10097 on Joomla 3.9.10

suchafan

  • Beginner
  • *
  • Posts: 14
Re: Current Stock Level Image/Text in VM2
« Reply #4 on: June 06, 2012, 05:40:54 am »
Hi Jenkin,

Thank you very much for your help. However, when I made the suggested change to the override file, it did remove the stock image and text but it also reduced the size of the page components. I attached a before and after image to show what happened. If you could give me a little insight as to what might be the problem it would be much appreciated.

Thanks again!!!

[attachment cleanup by admin]

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27466
  • Always on vacation
    • Jenkin Hill Internet
Re: Current Stock Level Image/Text in VM2
« Reply #5 on: June 06, 2012, 12:35:21 pm »
Looks like you are using a commercial theme so there will already be the template developers overrides which you will need to edit. Ask the template developer for support.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.3.10057 on Joomla 3.9.10 PHP 7.0.33
Testing VM 3.5.0.10097 on Joomla 3.9.10