News:

Support the VirtueMart project and become a member

Main Menu

Only show out of stock products for Adminstrator in frontend

Started by PostHistorie.nl, September 27, 2017, 12:07:57 PM

Previous topic - Next topic

PostHistorie.nl

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

PostHistorie.nl

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

Hello,

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

Best Regards,
hellorain.

Raincreatives - Virtuemart & Mobile Commerce Experts

PostHistorie.nl

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

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

PostHistorie.nl

Hmm yeah, I'm just curious why this was a feature in old vmart but has disappeared from the newer/latest version.

jenkinhill

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

PostHistorie.nl

#7
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 ?

PostHistorie.nl

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

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.

PostHistorie.nl

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

vmextend is a Joomla plugin called by Vm if no view/controller is found

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.