VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: suchafan on May 22, 2012, 07:33:16 AM

Title: Current Stock Level Image/Text in VM2
Post by: suchafan 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.
Title: Re: Current Stock Level Image/Text in VM2
Post by: suchafan 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?
Title: Re: Current Stock Level Image/Text in VM2
Post by: suchafan 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!!!
Title: Re: Current Stock Level Image/Text in VM2
Post by: jenkinhill 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


<?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
Title: Re: Current Stock Level Image/Text in VM2
Post by: suchafan 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]
Title: Re: Current Stock Level Image/Text in VM2
Post by: jenkinhill 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.