How to freeze front end product editing

  • Posts: 252
  • Thank you received: 1
8 years 3 months ago #247493

-- HikaShop version -- : HikaShop Business 2.6.3
-- HikaMarket version -- : HikaMarket Multivendor 1.7.0
-- Joomla version -- : 3.5
-- PHP version -- : 5.5.12

Hi,
Can I set the front end product editing to be read only once the product is approved by back end?

Thanks
Best Regards

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 3 months ago #247499

Hi,

There is no setting to do so, but it could be an interesting feature.

Still, it is possible to add that feature using a custom plugin.
The idea would be to "remove" the save/apply buttons in the toolbar and to refuse the save of an approved product in the front-end.

Thanks to the trigger "onHikamarketBeforeDisplayView(&$view)", you can access to the view object before the display of the view.
You can perform a getName() and a getLayout() to confirm that the view is the product edition ; then you can modify the variable "toolbar" to hide the saving buttons.
With the trigger "onBeforeProductUpdate(&$element, &$do)" you can refuse the saving depending the context (front-end, the logged user is a vendor) and also add a display message. Thanks to it you will be sure that the vendor won't save the products in the front-end.

www.hikashop.com/support/documentation/6...ntation.html#product
www.hikashop.com/support/documentation/1...arket-developer.html

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: 252
  • Thank you received: 1
8 years 3 months ago #247858

Hi Jerome,
Sorry but I've read the hikamarket development document and search through the code, I did't find the "onHikamarketBeforeDisplayView" declaration. It only appear once in \administrator\components\com_hikamarket\helpers\hlper.php

code removed by a moderator

Which folder and filename should I put my code?
Thanks for helpg me

Best regards
Scott

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

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 3 months ago #247886

Hi,

If you take a look at the HikaShop doc, you will see the HikaShop trigger.
www.hikashop.com/support/documentation/6...hopBeforeDisplayView
Now, HikaMarket have the exact same trigger but for HikaMarket.

Which folder and filename should I put my code?

Like I wrote, you have to create a plugin :

Still, it is possible to add that feature using a custom plugin.

So you need to create a Joomla custom plugin.

docs.joomla.org/Plugin

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: 252
  • Thank you received: 1
8 years 3 months ago #248211

Hi, Jerome,
I've created a plugin and put public function onHikamarketBeforeDisplayView(&$view) in it.
And I've published the plugin, but it seems never been triggered? Do I have to do other settings?

Best Regards
Scott

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 3 months ago #248213

Hi,

In the HikaMarket front-end product view, there is the activation of the "triggerView", so the trigger will be called by HikaMarket.

class productmarketViewproductmarket extends hikamarketView {
	protected $triggerView = true;

Now if your plugin trigger is not called it indicates that your plugin is not published or invalid.
Please check that your plugin is right in the group "hikamarket", is right installed and see by your Joomla, that his name is right formed (so Joomla can instantiate the plugin).
You can put an "exit" (or "die") in your class constructor to right check that it is loaded by Joomla.

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: twscott

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

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