- Posts: 252
- Thank you received: 1
How to freeze front end product editing
10 years 1 month ago #247493
by twscott
How to freeze front end product editing was created by twscott
-- 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
-- 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.
10 years 1 month ago #247499
by Jerome
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.
Replied by Jerome on topic How to freeze front end product editing
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,
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.
10 years 1 month ago - 10 years 1 month ago #247858
by twscott
Replied by twscott on topic How to freeze front end product editing
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
Thanks for helpg me
Best regards
Scott
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
Which folder and filename should I put my code?code removed by a moderator
Thanks for helpg me
Best regards
Scott
Last edit: 10 years 1 month ago by Jerome. Reason: [code] is nice
Please Log in or Create an account to join the conversation.
10 years 1 month ago #247886
by Jerome
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.
Replied by Jerome on topic How to freeze front end product editing
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.
docs.joomla.org/Plugin
Regards,
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.
Like I wrote, you have to create a plugin :Which folder and filename should I put my code?
So you need to create a Joomla custom plugin.Still, it is possible to add that feature using a 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.
10 years 1 month ago #248211
by twscott
Replied by twscott on topic How to freeze front end product editing
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
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.
10 years 1 month ago #248213
by Jerome
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.
Replied by Jerome on topic How to freeze front end product editing
Hi,
In the HikaMarket front-end product view, there is the activation of the "triggerView", so the trigger will be called by HikaMarket.
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,
In the HikaMarket front-end product view, there is the activation of the "triggerView", so the trigger will be called by HikaMarket.
Code:
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.245 seconds