News:

Support the VirtueMart project and become a member

Main Menu

Current Stock Level Image/Text in VM2

Started by suchafan, May 22, 2012, 07:33:16 AM

Previous topic - Next topic

suchafan

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

#1
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

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

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
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

suchafan

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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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