- Posts: 73
- Thank you received: 3
plugin with event onProductBlocksDisplay
11 years 11 months ago #177322
by ced1870
plugin with event onProductBlocksDisplay was created by ced1870
-- HikaShop version -- : 2.3.3
-- HikaMarket version -- : 1.4.4
Hi
I have developped a plugin for hikashop to add some data in the product creation page. It works with the event onProductBlocksDisplay
I don't see this event in Hikamarket and then I don't find the way to add my custom code to the frontend edition of a product.
I was able to do it in Hikashop, I shall be able to do it in Hikamarket too
Regards
CEd
-- HikaMarket version -- : 1.4.4
Hi
I have developped a plugin for hikashop to add some data in the product creation page. It works with the event onProductBlocksDisplay
I don't see this event in Hikamarket and then I don't find the way to add my custom code to the frontend edition of a product.
I was able to do it in Hikashop, I shall be able to do it in Hikamarket too
Regards
CEd
Please Log in or Create an account to join the conversation.
11 years 11 months ago #177327
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic plugin with event onProductBlocksDisplay
Hi,
There is also some triggers in the front-end for HikaMarket and you will find some information in the HikaMarket documentation.
www.hikashop.com/support/documentation/1...ProductBlocksDisplay
You need to use "onMarketProductBlocksDisplay" and also "onMarketAclPluginListing" like the sample in the documentation.
Regards,
There is also some triggers in the front-end for HikaMarket and you will find some information in the HikaMarket documentation.
www.hikashop.com/support/documentation/1...ProductBlocksDisplay
You need to use "onMarketProductBlocksDisplay" and also "onMarketAclPluginListing" like the sample in the documentation.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: ced1870
Please Log in or Create an account to join the conversation.
11 years 11 months ago #177341
by ced1870
Replied by ced1870 on topic plugin with event onProductBlocksDisplay
ok thank you
I have done this now, the plugin is loaded in the page but the event is not triggered
I tried a
just at the beginning of the function, and nothing happened
I'm testing in this view :
option=com_hikamarket&view=productmarket&layout=add
I have done this now, the plugin is loaded in the page but the event is not triggered
I tried a
Code:
var_dump($product);die;
I'm testing in this view :
option=com_hikamarket&view=productmarket&layout=add
Please Log in or Create an account to join the conversation.
11 years 11 months ago #177348
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic plugin with event onProductBlocksDisplay
Hi,
See the view "productmarket / form".
You have to be sure that the vendor have the right for "product / edit / plugin" and that's why the trigger "onMarketAclPluginListing" is also important.
Regards,
See the view "productmarket / form".
Code:
if(hikamarket::acl('product_edit_plugin')) {
$html = array();
JPluginHelper::importPlugin('hikashop');
JPluginHelper::importPlugin('hikamarket');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onMarketProductBlocksDisplay', array(&$this->product, &$html));
foreach($html as $h) {
echo $h;
}
}
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #177505
by ced1870
Replied by ced1870 on topic plugin with event onProductBlocksDisplay
I understand, but still no luck.
1/ added in my plugin
>> does nothing even if it should die the page
2/ tried to remove the condition "if(hikamarket::acl('product_edit_plugin')) {" in the form.php, then my plugin works !
So I think that there is a problem with the ACL. I have no idea where to look at ...
1/ added in my plugin
Code:
function onMarketAclPluginListing(&$categories) {
var_dump($categories);die;
// Your plugin can interact with product editing in the front-end.
$categories['product'][] = 'productextrafieldck';
}
>> does nothing even if it should die the page
2/ tried to remove the condition "if(hikamarket::acl('product_edit_plugin')) {" in the form.php, then my plugin works !
So I think that there is a problem with the ACL. I have no idea where to look at ...
Please Log in or Create an account to join the conversation.
11 years 11 months ago #177506
by ced1870
Replied by ced1870 on topic plugin with event onProductBlocksDisplay
stop !
it works. I had to go in the hikamarket >> config >> access levels >> find my plugin name in the product edit options and enable it
wow, this is complicated, but it works
CEd
it works. I had to go in the hikamarket >> config >> access levels >> find my plugin name in the product edit options and enable it
wow, this is complicated, but it works
CEd
Please Log in or Create an account to join the conversation.
11 years 11 months ago #177507
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic plugin with event onProductBlocksDisplay
Hi,
I'll see to update the documentation in order to give more details about the ACL system.
The goal of HikaMarket is to not let an access to the user if he does not have the corresponding right.
Regards,
I'll see to update the documentation in order to give more details about the ACL system.
The goal of HikaMarket is to not let an access to the user if he does not have the corresponding right.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #177520
by ced1870
Replied by ced1870 on topic plugin with event onProductBlocksDisplay
yes I understand the logic and this is great. Just not easy to know when you develop the plugin because you don't know that you have to allow it before it can work.
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.214 seconds