News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

VM3.0.10: inventory does not show unpublished items

Started by stawebnice, October 31, 2015, 23:03:39 PM

Previous topic - Next topic

stawebnice

Hi,

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

Thanks.

Petra

John2400

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.

AH

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);
Regards
A

Joomla 4.4.5
php 8.1

stawebnice

Thank you, I will try it out, seem like good solutions to me both...

AH

And this is Hutson - lol -  your post to Pro in another message :-)
Regards
A

Joomla 4.4.5
php 8.1

stawebnice


AH

Regards
A

Joomla 4.4.5
php 8.1

stawebnice


Milbo

AH forgot to mention, that i added his line, so unpublished products should be loaded.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

stawebnice

Perfect, is it in live version already, or will you send me last build for testing, Max?

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/