Author Topic: Only show out of stock products for Adminstrator in frontend  (Read 428 times)

willempasterkamp

  • Beginner
  • *
  • Posts: 33
Only show out of stock products for Adminstrator in frontend
« on: September 27, 2017, 12:07:57 pm »
Hello,

I notice there are several out-of-stock options available under configuration, what I'm looking for is a way to show sold/out of stock products in the frontends but only for logged in adminstrators.

Now I can add a Notify and more, but we would like not to confuse our customers and just not display unorderable products (since all items we sell are unique). But the adminstrators would need this feature for catalogue reasons.

Is such a thing possible?

Cheers,
Jan

willempasterkamp

  • Beginner
  • *
  • Posts: 33
Re: Only show out of stock products for Adminstrator in frontend
« Reply #1 on: October 02, 2017, 13:18:21 pm »
I'm sorry, I totally forgot to mention my setup: VirtueMart 3.2.4 / Joomla! 3.7.5 Stable / PHP 5.6.30-0+deb8u1
 

hellorain

  • Jr. Member
  • **
  • Posts: 71
    • Raincreatives - Virtuemart & Mobile Commerce Experts
  • Skype Name: support.raincreatives
Re: Only show out of stock products for Adminstrator in frontend
« Reply #2 on: October 02, 2017, 16:29:26 pm »
Hello,

It can achieve By Access level feature of joomla along with Notify me button virtumart.

Best Regards,
hellorain.

Raincreatives - Virtuemart & Mobile Commerce Experts

willempasterkamp

  • Beginner
  • *
  • Posts: 33
Re: Only show out of stock products for Adminstrator in frontend
« Reply #3 on: October 03, 2017, 13:03:46 pm »
Interesting approach!
This could indeed prevent non-adminstrative users from seeing the notify button, HOWEVER I want to completely hide the out-of-stock products for non-administrators (not just the button).

hellorain

  • Jr. Member
  • **
  • Posts: 71
    • Raincreatives - Virtuemart & Mobile Commerce Experts
  • Skype Name: support.raincreatives
Re: Only show out of stock products for Adminstrator in frontend
« Reply #4 on: October 03, 2017, 13:14:12 pm »
Hi,

Then you can apply that access level filtering to whole product column/visibility. This may need some changes in layout file of VirtueMart.

Best Regards,
Raincreatives - Virtuemart & Mobile Commerce Experts

willempasterkamp

  • Beginner
  • *
  • Posts: 33
Re: Only show out of stock products for Adminstrator in frontend
« Reply #5 on: October 03, 2017, 13:33:19 pm »
Hmm yeah, I'm just curious why this was a feature in old vmart but has disappeared from the newer/latest version.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26428
  • Always on vacation
    • Jenkin Hill Internet
Re: Only show out of stock products for Adminstrator in frontend
« Reply #6 on: October 03, 2017, 15:47:30 pm »
If you have ACL set correctly store admins can log into the frontend and access the product inventory.   /index.php?option=com_virtuemart&view=inventory

Selecting the "Product not in stock!" allows them to view the out of stock items.   A superadmin can do this at any time.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM3.2.10 on Joomla 3.8.3 PHP 7.0.25

Testing VM3.2.10.9700 on J3.8.3

willempasterkamp

  • Beginner
  • *
  • Posts: 33
Re: Only show out of stock products for Adminstrator in frontend
« Reply #7 on: October 04, 2017, 13:33:27 pm »
Ok this is getting somewhere. However under Global Configuration -> Component -> VirtueMart I can see the SuperUser is Allowed to everything (including Inventory access).

So I am not sure how to use this ACL setting to view out-of-stock products in the frontend.
Because how do I access  /index.php?option=com_virtuemart&view=inventory (from the frontend) when it gets rewritten immediately to index.php?option=com_virtuemart&view=virtuemart? This only seems to work for the backend.

Or what setting I need under Virtuemart->Configuration->Shopfront->Action when a Product is Out of Stock ?

willempasterkamp

  • Beginner
  • *
  • Posts: 33
Re: Only show out of stock products for Adminstrator in frontend
« Reply #8 on: October 04, 2017, 15:03:30 pm »
I think I know what you mean jenkinhill however this is just making the inventory list available. Which is a list of items (text).

What I would like / need is just the regular site (with pictures etc.) as a catalogue where I can browse freely as Administrator without worrying that my users see out of stock products. Because only the admin sees those.
I think this was a default in old virtuemart.

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2433
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Only show out of stock products for Adminstrator in frontend
« Reply #9 on: October 12, 2017, 13:56:32 pm »
If you really need this, then you can write a vmextended plugin only for Admins to show the catalog.
And if you want, in vmextended plugin, you can change the render, if the plugin is right coded and permit overrides.
The plugin have then total control of all and you can write own code, filters ... and for eg permit a CSV export for admins only.

willempasterkamp

  • Beginner
  • *
  • Posts: 33
Re: Only show out of stock products for Adminstrator in frontend
« Reply #10 on: October 12, 2017, 14:02:02 pm »
Ok... I have a little bit of programming experience but I don't know what vmextended is.

I found this: https://open-tools.net/documentation/tutorial-extending-vm-with-custom-views.html (seems helpful).

Can you point me in the right direction a little bit more if I would want to implement this catalogue function?

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2433
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Only show out of stock products for Adminstrator in frontend
« Reply #11 on: October 12, 2017, 14:34:10 pm »
vmextend is a Joomla plugin called by Vm if no view/controller is found

Code: [Select]
else {
// try plugins
JPluginHelper::importPlugin('vmextended');
$dispatcher = JDispatcher::getInstance();
$rets = $dispatcher->trigger($trigger, array($_controller));

If you know how Joomla plugin system plugin work, then you can do it.
Else you need to read the doc for Joomla plugins and vmextend plugins.
If you need to overide views, then you  need to know how to add it.

I don't said, it's easy to do, but how you can do it.
Of course a more generic solution, is to write a Joomla system plugin(or a full component). In this case you can write it exactly as you want and add any function you need.