VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: stawebnice on October 31, 2015, 23:03:39 PM

Title: VM3.0.10: inventory does not show unpublished items
Post by: stawebnice on October 31, 2015, 23:03:39 PM
Hi,

please, is there a way to show unpublished items in Inventory , so that we could see stocks for unpublished products too

Thanks.

Petra
Title: Re: VM3.0.10: inventory does not show unpublished items
Post by: John2400 on November 03, 2015, 11:02:47 AM
You could just make a shopper group that no one sees... eg

call it 'unpublished' or 'not for sale'.. group

place the product in that group..

inventory would be seen and the product would not show in the shop.
Title: Re: VM3.0.10: inventory does not show unpublished items
Post by: AH on November 03, 2015, 11:55:29 AM
You can easily make an override to the product list in admin that would show the stock:-

administrator/templates/isis/html/com_virtuemart/product/default.php

I like to have available and stock ("available" takes note of items that are on order)



$available = $product->product_in_stock - $product->product_ordered;
                        if ($available < 1){
                            echo "<div class='stockout'>";
                            echo "Out ". $available;
                        } elseif ($available > 1 && $available < $product->low_stock_notification ) {
                            echo "<div class='stocklow'>";
                            echo "Low ". $available;
                        } else {
                            echo "<div class='stockok'>";
                            echo "In ". $available;
                        }
                        echo "</div>";

                        echo 'Stk: '.$product->product_in_stock;




The divs just allow me to set colours via css



However if you must have this on the inventory page then the problem is in:-

administrator/components/com_virtuemart/views/inventory/view.html.php


$this->inventorylist = $model->getProductListing();

This assumes that only published is required and can be changed to:-


$this->inventorylist = $model->getProductListing(false,false,false,false);
Title: Re: VM3.0.10: inventory does not show unpublished items
Post by: stawebnice on November 03, 2015, 14:05:33 PM
Thank you, I will try it out, seem like good solutions to me both...
Title: Re: VM3.0.10: inventory does not show unpublished items
Post by: AH on November 04, 2015, 09:46:27 AM
And this is Hutson - lol -  your post to Pro in another message :-)
Title: Re: VM3.0.10: inventory does not show unpublished items
Post by: stawebnice on November 04, 2015, 10:19:11 AM
Excuse me? What are you talking about?
Title: Re: VM3.0.10: inventory does not show unpublished items
Post by: AH on November 04, 2015, 10:39:54 AM
OOPs wires completely crossed - ignore :-)
Title: Re: VM3.0.10: inventory does not show unpublished items
Post by: stawebnice on November 04, 2015, 13:16:12 PM
OK, great to see that I am still sane :-)))
Title: Re: VM3.0.10: inventory does not show unpublished items
Post by: Milbo on November 06, 2015, 21:59:29 PM
AH forgot to mention, that i added his line, so unpublished products should be loaded.
Title: Re: VM3.0.10: inventory does not show unpublished items
Post by: stawebnice on November 06, 2015, 22:05:03 PM
Perfect, is it in live version already, or will you send me last build for testing, Max?
Title: Re: VM3.0.10: inventory does not show unpublished items
Post by: Milbo on November 12, 2015, 15:28:13 PM
http://virtuemart.net/news/latest-news/473-security-release-virtuemart-3-0-12