- Posts: 8
- Thank you received: 0
call plugin on order display administrator and custom fields
is there a method i can call in my plugin to get a shipping plugin to be showed in the administrator order view (/administrator/index.php?option=com_hikashop&ctrl=order&task=edit&cid[]=1) page ?
also is there a way i can check or even create a custom field upon running a plugin, so that i can make sure the custom fields i need, exists and if not just create them automatic ?
regards
Jesper
Please Log in or Create an account to join the conversation.
Yes. The Display API triggers onHikashopBeforeDisplayView(&$view) and onHikashopAfterDisplayView(&$view) are called on all the views of HikaShop, including this one:
www.hikashop.com/support/documentation/6...ntation.html#display
So you can implement these triggers, check the current controller and task in the URL or in the $view object and then add your HTML where you want.
Please Log in or Create an account to join the conversation.
thanx that answers one of two questions
can you answer the other also ?
Please Log in or Create an account to join the conversation.
var $pluginConfig = array(
'username' => array('USERNAME', 'input'),
'password' => array('PASSWORD', 'input'),
'customerid' => array('CUSTID', 'input'),
'contactid' => array('CONTID', 'input'),
);
parameter
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
For the custom fields, you can check with a MySQL query in the constructor of your plugin class and insert it in the hikashop_field table if missing with another MySQL query and finally add the column with a third MySQL query.
So it sure is possible.
Regarding the plugin parameters it will actually depends on the type of plugin you are using, the best solution will be to directly check the code of our plugins.
Please Log in or Create an account to join the conversation.
i have not found any solutions in any shipping plugins i have been able to use... go an idea which plugin i should look into.
i will look at the sql for the fields, though you should make a hikashop call that can check fields and create them.
Please Log in or Create an account to join the conversation.
We thought that you were talking about custom fields that you can create via the menu Display>Custom fields. If you're talking about fields that you want to add to a random view and not go through the standard custom field system of HikaShop, then it's something else.
It's really easy to display input fields in a view:
Please Log in or Create an account to join the conversation.
they have been defined like this
so now i need to get to that info that the user admin have added in the configuration in the plugin
Please Log in or Create an account to join the conversation.
So it looks like you're developing a shipping plugin.
In that case, you can use such code:
Please Log in or Create an account to join the conversation.
now about checking the fields in mysql, i did
but i get
Please Log in or Create an account to join the conversation.
Did you add the pakkeshop column in the hikashop_order as Mohamed explained in his previous message ?
and finally add the column with a third MySQL query
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.