create product plugin
11 years 10 months ago #181030
by kaya
create product plugin was created by kaya
Hi dear
May be create a product plugin for show data in product page? I can not found document.
May be create a product plugin for show data in product page? I can not found document.
Please Log in or Create an account to join the conversation.
11 years 10 months ago #181052
by Xavier
Replied by Xavier on topic create product plugin
Hi,
Here is the documentation for the plugins:
www.hikashop.com/support/support/documen...r-documentation.html
Here is the documentation for the plugins:
www.hikashop.com/support/support/documen...r-documentation.html
Please Log in or Create an account to join the conversation.
11 years 10 months ago - 11 years 10 months ago #181132
by kaya
Replied by kaya on topic create product plugin
Thank you dear Xavier
I want show custom plugin's data on display product block in front end use this method?
onAfterProductCreate(&$element)
for example see demo url
demo.hikashop.com/index.php?option=com_h...e=&Itemid=78&lang=en
I want create custom plugin and show data on product page.
I want show custom plugin's data on display product block in front end use this method?
onAfterProductCreate(&$element)
for example see demo url
demo.hikashop.com/index.php?option=com_h...e=&Itemid=78&lang=en
I want create custom plugin and show data on product page.
Last edit: 11 years 10 months ago by kaya.
Please Log in or Create an account to join the conversation.
11 years 10 months ago #181138
by Xavier
Replied by Xavier on topic create product plugin
Hi,
If you just want to display custom data on product page, you can use the custom fields.
The trigger onAfterProductCreate(&$element) allow to do action after a product is created, not when displayed.
Here is the documentation for the custom fields:
www.hikashop.com/support/support/documen...shop-field-form.html
If you just want to display custom data on product page, you can use the custom fields.
The trigger onAfterProductCreate(&$element) allow to do action after a product is created, not when displayed.
Here is the documentation for the custom fields:
www.hikashop.com/support/support/documen...shop-field-form.html
Please Log in or Create an account to join the conversation.
11 years 10 months ago #181264
by kaya
Replied by kaya on topic create product plugin
but I do not want use custom field I want develop a plugin if say me what trigger I can use I can develop my plugins.
thank you.
thank you.
Please Log in or Create an account to join the conversation.
11 years 10 months ago #181287
by nicolas
Replied by nicolas on topic create product plugin
Hi,
In that case, you want to implement the onHikashopBeforeDisplayView www.hikashop.com/support/support/documen...hopBeforeDisplayView trigger and add your custom HTML as an element of an attribute array (these arrays are available : topBegin topEnd leftBegin leftEnd rightBegin rightMiddle rightEnd bottomBegin bottomMiddle bottomEnd) of the object $view->element->extraData
So for example:
In that case, you want to implement the onHikashopBeforeDisplayView www.hikashop.com/support/support/documen...hopBeforeDisplayView trigger and add your custom HTML as an element of an attribute array (these arrays are available : topBegin topEnd leftBegin leftEnd rightBegin rightMiddle rightEnd bottomBegin bottomMiddle bottomEnd) of the object $view->element->extraData
So for example:
Code:
function onHikashopBeforeDisplayView(&$view){
$viewName = $view->getName();
$layout = $view->getLayout();
if($viewName!='product' || $layout!='show') return;
$view->element->extraData->topBegin[]='my text at the top of the product page';
}
The following user(s) said Thank You: kaya
Please Log in or Create an account to join the conversation.
11 years 10 months ago #181400
by kaya
Replied by kaya on topic create product plugin
thank you dear nicolas
your code work now how can show data on under product image? or it's work only top of the product?
your code work now how can show data on under product image? or it's work only top of the product?
Please Log in or Create an account to join the conversation.
11 years 10 months ago #181422
by Xavier
Replied by Xavier on topic create product plugin
Hi,
You can edit the view "product / show_default" move:
Just after the product image display code, and then in your plugin add extradata for "topEnd" like:
You can edit the view "product / show_default" move:
Code:
<?php if(!empty($this->element->extraData->topEnd)) { echo implode("\r\n",$this->element->extraData->topEnd); } ?>
Code:
$view->element->extraData->topEnd[]='my text just after the image';
The following user(s) said Thank You: kaya
Please Log in or Create an account to join the conversation.
11 years 10 months ago #181537
by kaya
Replied by kaya on topic create product plugin
Hi dear Xavier
Thank you I do not want core hack I want do it without core hack. if is possible do it without core hack help me.
thank you very much.
Thank you I do not want core hack I want do it without core hack. if is possible do it without core hack help me.
thank you very much.
Please Log in or Create an account to join the conversation.
11 years 10 months ago #181552
by nicolas
Replied by nicolas on topic create product plugin
Hi,
First, view overrides via the menu Display>Views of HikaShop are NOT core hacks. They are stored as view overrides and are not lost when you update your shop.
Second, I already explained that you could use other places on the page with the other arrays available in the code of the plugin:
topBegin topEnd leftBegin leftEnd rightBegin rightMiddle rightEnd bottomBegin bottomMiddle bottomEnd
So it's like that for the bottom of the image:
First, view overrides via the menu Display>Views of HikaShop are NOT core hacks. They are stored as view overrides and are not lost when you update your shop.
Second, I already explained that you could use other places on the page with the other arrays available in the code of the plugin:
topBegin topEnd leftBegin leftEnd rightBegin rightMiddle rightEnd bottomBegin bottomMiddle bottomEnd
So it's like that for the bottom of the image:
Code:
$view->element->extraData->leftEnd[]='my text at the bottom of the image';
The following user(s) said Thank You: kaya
Please Log in or Create an account to join the conversation.
11 years 10 months ago #181608
by kaya
Replied by kaya on topic create product plugin
Thank you dear nicolas
This is exactly what I wanted
This is exactly what I wanted
Please Log in or Create an account to join the conversation.
Time to create page: 0.268 seconds