Author Topic: VM3.0.10: inventory does not show unpublished items  (Read 1466 times)

stawebnice

  • Jr. Member
  • **
  • Posts: 265
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
VM3.0.10: inventory does not show unpublished items
« 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

John2400

  • Virtuemart - the Future is ever Changing
  • Global Moderator
  • Full Member
  • *
  • Posts: 1568
  • VirtueMart Version: Use VM3.6+
Re: VM3.0.10: inventory does not show unpublished items
« Reply #1 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.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3513
  • VirtueMart Version: 4.0.12.10777
Re: VM3.0.10: inventory does not show unpublished items
« Reply #2 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)

Code: [Select]

 $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


Code: [Select]
$this->inventorylist = $model->getProductListing();
This assumes that only published is required and can be changed to:-

Code: [Select]
$this->inventorylist = $model->getProductListing(false,false,false,false);
Regards
A

Joomla 3.10.11
php 8.0

stawebnice

  • Jr. Member
  • **
  • Posts: 265
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
Re: VM3.0.10: inventory does not show unpublished items
« Reply #3 on: November 03, 2015, 14:05:33 pm »
Thank you, I will try it out, seem like good solutions to me both...

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3513
  • VirtueMart Version: 4.0.12.10777
Re: VM3.0.10: inventory does not show unpublished items
« Reply #4 on: November 04, 2015, 09:46:27 am »
And this is Hutson - lol -  your post to Pro in another message :-)
Regards
A

Joomla 3.10.11
php 8.0

stawebnice

  • Jr. Member
  • **
  • Posts: 265
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
Re: VM3.0.10: inventory does not show unpublished items
« Reply #5 on: November 04, 2015, 10:19:11 am »
Excuse me? What are you talking about?

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3513
  • VirtueMart Version: 4.0.12.10777
Re: VM3.0.10: inventory does not show unpublished items
« Reply #6 on: November 04, 2015, 10:39:54 am »
OOPs wires completely crossed - ignore :-)
Regards
A

Joomla 3.10.11
php 8.0

stawebnice

  • Jr. Member
  • **
  • Posts: 265
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
Re: VM3.0.10: inventory does not show unpublished items
« Reply #7 on: November 04, 2015, 13:16:12 pm »
OK, great to see that I am still sane :-)))

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10545
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM3.0.10: inventory does not show unpublished items
« Reply #8 on: November 06, 2015, 21:59:29 pm »
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

  • Jr. Member
  • **
  • Posts: 265
  • What does not kill you, makes you stronger...
    • StaWEBnice - www stránky, seo optimalizace a copywriting
  • Skype Name: peta_ze_sklepa
  • VirtueMart Version: 3.2.14
Re: VM3.0.10: inventory does not show unpublished items
« Reply #9 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?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10545
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/