News:

Looking for documentation? Take a look on our wiki

Main Menu

Stocklevel on product detail page

Started by groentjie, January 03, 2012, 15:19:09 PM

Previous topic - Next topic

groentjie

How can I show the stocklevel graphic on the productdetail page?

flaterik

Same problem.
I try to use the function for the category view but doesn't work

The field that doesn't work is
<span title="" class="vmicon vm2-"></span>

The variable <?php echo $product->stock->stock_level ?> is empty. That we need is how to use this var on productdetails . On category work correctly, so i think that could be use on productdetails but the field isn't the same or is necessary to load another part of code


supermac

I found this solution, even if I don't like to modify php pages....
Place this piece of code where you like to show the product's stock in productdetail page
( \components\com_virtuemart\views\productdetails\tmpl\default.php)


<?php 
$stato "";
$statotip "";
if ($this->product->product_in_stock 10) {
$stato "nostock";
$statotip "Hurry! Very low items stock!";
} else {
if ($this->product->product_in_stock 40) {
$stato "lowstock";
$statotip "Low items in stock!";
} else {
$stato "normalstock";
$statotip "Items in stock available!";
}
?>

<span class="vmicon vm2-<?php echo $stato ?>" title="<?php echo $statotip ?>"></span>



:-[ sorry for my poor english  :-[

huegel-huepfer

That helped me a lot, thanks!

At the moment I try to display current stock of an child product in parent product page.


I placed the stock variants plugin in my parent product. There you can choose between different parameters.
The regular "Availability Image" does show the current stock of the chosen child, but the "vmicon" does still show parents availability...


Are there any suggestions how to realize what I want?
Joomla 2.5.6

VM 2.0.8e

maxi1973

For anyone have a multilanguage website, i've adopted this modification to SUPERMAC (thank you ;)) to have availability in multilanguage.
i've done a little modification to have NO availability for <1 product; low availability for <4 products otherwise large availability.


<?php 
$stato "";
$statotip "";
if ($this->product->product_in_stock 1) { ?>

<?php $stato = "nostock"; ?>
<?php $statotip =  JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_OUT_TIP'); ?>
<?php } else {
if ($this->product->product_in_stock 4) {?>

<?php $stato = "lowstock"; ?>
<?php $statotip = JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_LOW_TIP'); ?>;
<?php } else { ?>
<?php $stato = "normalstock"; ?>
<?php $statotip = JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_NORMAL_TIP'); ?>;
<?php }
?>


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

</div>
<?php }?>

Maxim Pishnyak

You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

lostmail

I have currently a mysterious thing between category fiew and product details view:

In Category view 2 products are yellow and green status but both products have the same stock amount 1 pcs.

So the green bar from product 1 is wrong - it should even be yellow in category view.

wheni click in produt detail - both products are yellow - what is correct.





[attachment cleanup by admin]
VirtueMart VirtueMart 4.2.16 11030 | Joomla 4.x | PHP 8.3 | Vp_neoteric 1.6

lostmail

It seems to be the field "Message for low stock level" - i have one product set to "0" and the other "5".
So in category view the first product has not a "low stock level"....

How can I set a hard coded low stock level (default for all products) for category view ?

In product details i have a hard coded low stock level of "5"
VirtueMart VirtueMart 4.2.16 11030 | Joomla 4.x | PHP 8.3 | Vp_neoteric 1.6

lanthan

#9
Hi lostmail,
donĀ“t know if you still need this. If you use my solution (see link), you can edit the "low stock level" on the productstatus page of your product.

http://forum.virtuemart.net/index.php?topic=122391.msg417891#msg417891

Best regards