plugin with event onProductBlocksDisplay

  • Posts: 73
  • Thank you received: 3
9 years 5 months ago #177322

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

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 5 months ago #177327

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,


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

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

  • Posts: 73
  • Thank you received: 3
9 years 5 months ago #177341

ok thank you
I have done this now, the plugin is loaded in the page but the event is not triggered
I tried a

var_dump($product);die;
just at the beginning of the function, and nothing happened

I'm testing in this view :
option=com_hikamarket&view=productmarket&layout=add

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 5 months ago #177348

Hi,

See the view "productmarket / form".

	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;
		}
	}
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,


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: 73
  • Thank you received: 3
9 years 5 months ago #177505

I understand, but still no luck.

1/ added in my plugin

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.

  • Posts: 73
  • Thank you received: 3
9 years 5 months ago #177506

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

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 5 months ago #177507

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,


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: 73
  • Thank you received: 3
9 years 5 months ago #177520

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.065 seconds
Powered by Kunena Forum