Product approvals and ACL

  • Posts: 72
  • Thank you received: 0
8 years 9 months ago #206018

-- HikaShop version -- : 2.5
-- HikaMarket version -- : 1.6.3

Dear Sir
1. I set the configuration of product approval to yes, after my vendor add a product, I logged in using admin count but I cant see approve button, please advice
2. is it possible to give add product privilege to vendor (so he can see all fields of the product) but do not allow him to edit those product after created , I mean if edit, only he can display the fields not edit them, this is because I do not want any vendor to change the product after I publish it
thanks

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
8 years 9 months ago #206024

Hi,

1. The approval button is just display in the front-end.
I wanted to add the button in the backend too but I got some issues so I postpone the feature for a next release.

2. I think the easier for the moment will be to use a custom plugin to refuse product edition in the front-end.
Because HikaShop make the difference between "productadd" and "productupdate" ; you can know when a product is updated and have details about the context.
So you can use the "onBeforeProductUpdate" trigger and refuse the vendor to update their products. But they could still add new one.
Otherwise, I noted your request and I'll see how the ACL system could be improved to manage that case.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
8 years 9 months ago #206082

thanks for the response
1. but no approve bottom appeared even if I login by admin user (super user)
2. can you please elaborate more, do you mean to present the update and once he submit I discard the changes using onBeforeProductUpdate?

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
8 years 9 months ago #206088

Hi,

1. Are you sure that you have activated the "product approval" feature and that the admin have the right "product / approval" ?
Because the main vendor can see the products which are waiting approval in the HikaMarket front-end product listing.
They have an "unpublish" icon just before the product name.
And when you edit a product which is waiting for an approval ; you will see a button in the toolbar, with the other buttons (save, apply, back, etc).

2. I mean that the trigger allow you to refuse any modification of the product by the vendor.
It will just cancel the save.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
8 years 9 months ago #206226

thanks
I tried to write the plugin but for certain reason its not working
I just want to unpublish the product if its been changed, I write XML file as well as the below simple code php file, install them from extension manager, enabled the plugin, still its not working

<?php
class mymall_custom_code extends JPlugin {
	function mymall_custom_code(&$subject, $config){
		parent::__construct($subject, $config);
	}
	
	function onBeforeProductUpdate(&$product, &$do) {
	$product->product_published = 0; 
 	return true;
	}
}
?>

Last edit: 8 years 9 months ago by Jerome. Reason: [code] is nice

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
8 years 9 months ago #206234

Hi,

Like I wrote before, you have to use the trigger to refuse any modification ; not to perform an extra modification.. And not in all contexts...
Please understand that we are currently going outside the support we can offer ; It is currently custom code.

function onBeforeProductUpdate(&$product, &$do) {
   $app = JFactory::getApplication();
   // Only for the front-end and when HikaMarket is running
   if($app->isAdmin() || !defined('HIKAMARKET_COMPONENT'))
      return true;

   // Get the vendor
   $vendor_id = hikamarket::loadVendor(false, false);

   // Only for the vendors, not the main vendor
   if($vendor_id == 0 || $vendor_id == 1)
      return true;

   // Stop the process
   $do = false;
   return false;
}

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
8 years 9 months ago #206447

thanks Sir
My problem is the trigger itself is not being fired on product update on the front end, cause nothing happened after I update the product, its still updating it

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
8 years 9 months ago #206448

Update:
I installed plgHikashopDump_Events and I can see that its calling onBeforeProductUpdate but I doubt its my trigger (cause I change my trigger to onAfterProductUpdate and still not fired after updating any product) also its do not cancel the update as it suppose to do
Please advice

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
8 years 9 months ago #206476

Dear Sir
it looks I had some problem with the plugin, I delete it and installed it again and it worked
now I noticed that the publish/unpublish icons is not appearing at the vendor front end product listing when I remove the publish privileged from the ACL , my question I still do not want the vendor to publish or unpublished the product, but at least I want to show the status of the product weather is published or no, how I can achieve that

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
8 years 9 months ago #206483

Hi,

The best way will be to remove then the right and to use a view override in order to display the information in the product listing :

echo $this->toggleClass->display('activate', (int)$product->product_published);

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
8 years 9 months ago #206524

I do not understand, when I am supposed to place this code
thanks

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
8 years 8 months ago #206528

Hi,

In the view "productmarket | listing".

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
8 years 8 months ago #206560

thanks but can you please advice where exactly ??

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
8 years 8 months ago #206605

Hi,

You can place the code in several different places in the view ; it will be highly depend on how you want to display that information (and where in the table).
So I can't tell you where exactly ; but a good start will be to place the code near the existing code which display the toggle for the " product_published ", don't you think ?
Otherwise it could be placed in the same cell than the product name ; maybe align on the right.
Or you can add a new column just for that..
It is really up to you and I can't tell you right now which one is the best (I need to perform some UX tests).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 8 years 8 months ago by Jerome.

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
8 years 8 months ago #206859

Hi,

I must join this thread - for two reasons:
1.) I also can not get the Main Vendor or Admin (Joomla Super User) to see unapproved products in the frontend.
2.) We should get this approval thing to work, and user "mymall" must not use (un-)publish instead.

1.)
a.) Upon installation of HikaMarket the Main Vendor was empty. Unfortunately, the documentation doesn't say anything what to do. So, I added one with same name and email as Admin (= site owner, all access rights), and made sure he doesn't inherit ACL but has all ACL boxes checked. But that doesn't cut it: when logged in as Admin into the frontend, I can't see unapproved product. I suspect the way I did it, Main Vendor and Admin are not the same? So.....
b.) I added the Admin to the Main Vendor, again making sure that all his ACL boxes are checked. Still no joy, still no unapproved products visible when logged into frontend as Admin. :(

What does it take? Jerome, please enlighten us...

2.)
a.) Once approval works, this is the Admin tool to "turn products on or off" (I'm avoiding other words to not confuse things). No doubt, it should always (by default) be unchecked in the vendor ACL.
b.) Publishing and unpublishing can - if desired - be granted to the vendor to make his product visible or not on the site, e.g. he can unpublish it if it's no longer available.
c.) Not mentioned here, but product deletion must also be an Admin tool. For obvious reasons, it must not be used by a vendor for the purpose to make a product "invisible". It should always (by default) be unchecked in the vendor ACL.

3.) More on approval:
I haven't even seen the approval button, and sure not used it - again, I can't see unapproved product. However, I'm hoping it is a toggle (approve <--> disapprove), because only then it makes sense: the Admin must anytime be able to use disapproval to "hide" a vendor product without interference by the vendor. Unpublishing is not an option for it, as eventually the vendor can publish it again (and, as stated, the vendor also needs a tool to "hide" his products from public view).
Needless to say, unapproved product and the approval feature/toggle MUST urgently become visible and usable in the backend. Otherwise it can lead to all sorts of awkwardness, e.g. if a vendor unpublishes an unapproved product: it would be invisible to Admin in frontend and backend, unless he used a series of tricks.....
Finally, since the addition of the approval feature (if related or not), other things like the vendor product category settings in combo with category ACL setting aren't working as expected and previously anymore - as discussed in another lengthy thread. Mysterious...


So, let's have a properly working and easy-to-use approval feature with toggle and backend use. We could all stop our horrible workarounds: mymall his/her code project, and myself the detour via hidden product categories, and who knows what tricks others are forced to come up with, yet... ;)

Thanks Jerome!

Edit:
Ok, here's a bit of documentation on Main Vendor/Admin: www.hikashop.com/support/documentation/2...tml#tuto_your_vendor
Not that it helped me, but anyway...


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 8 years 8 months ago by lousyfool.

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
8 years 8 months ago #206945

Hi,

Other reference : www.hikashop.com/forum/23-market-how-to/...y-vendor.html#206937

The past months I worked a lot for HikaShop itself (new product edition, Web services, new checkout system, new cart system) and these developments are not all finished but the community will have a lot of new improvements for the next releases (specially for HikaShop 3).
Some elements in the HikaMarket TODO list are depending on HikaShop features ; that is also why I have to delay HikaMarket 1.7 because I got some blocking requirements for my next features.

The product approval is in the same kind of development that the product trash but it is in fact a sub-section of the product versionning.
In fact, the product approval will be removed in HikaMarket when the product versionning will be integrated.
That is also why I didn't update the feature that much ; it is not something I planned and that's not how I imagined the feature.

Regarding the other thread, I now understand the concept of the "disapproval" and once again I think it will be better with the versionning system.
Because you will have a validation workflow where a version could have a state, commentaries and notifications.
So yes, I see what you means and that's already in my head since a long time ; but to do it like I want to do it, I need to perform some modifications in HikaShop in order to handle it.

So I won't copy/past what I have already written in the other thread about how that product approval feature has been added.
And if I knew, I wouldn't accept to add it 8 months ago because it is not something in my vision of HikaMarket.
But if today it could help users, it's cool and I'm glad ; now it has a lot of limitations and I don't want to spent too much time on it while I could progress on the real full feature.

The goal of the product approval is to not publish directly a vendor product while giving to the vendor the "publish/unpublish" ACL right.
Otherwise you can use the a product template and remove the ACL "product / edit / publish" and then keep the control on the product publishing.
It is not the workflow that the product versionning will have but it is something which can already help.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: lousyfool

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
8 years 8 months ago #206953

Hi Jerome,

Interesting read. A bit sad to see the time spent on approvals by some - you in the first place - but the long-term view is much appreciated, plus versioning having so much more potential and additional benefits, of course... I remember it had come up some time ago when sort of "security" was the topic.

In any case, thank you for the open words. I'll think about it during the next few days, and might look at approvals from a different angle now, but that doesn't make it worse. Even though the future might still be some time away (I don't expect any statements on "when"), and even "some" approval functionality being better than none (except for workarounds), hanging on to approvals as they are could be risky considering a site aiming at hundreds of vendors, many categories, brands, quite a bit of customisation etc etc - not to mention the strain it could cause for support... it already has these past days.
Approvals as they work now may help some, indeed, and I need to find out if it's for me at the present state, and imagining it "frozen" as I wouldn't want to bug you for "beating a dead horse", haha. So, I'll see that I get approvals going at least for a few more tests on stability and practical usability, then decide. There's always the workaround with hidden categories, and possibly some other tricks..

Might sound pathetic, but as a matter of fact, whatever you guys do, you are standing behind it and the users with timely and brilliantly sufficient support. Truly amazing. So, I have all the faith in you and your future developments.

Thanks,
T


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.097 seconds
Powered by Kunena Forum