How to add more info in Orders informations page

  • Posts: 12
  • Thank you received: 0
10 months 1 week ago #330587

Hi.

In my payment plugin, I need to add some additional information, at the Orders page as shown in screenshot.





I have to add informations inside Additional Information section, would be beter even to be able to create a new section there.

I have infos inside the onPaymentNotification, and from onPaymentNotification i should send to Orders page.

Lirim.

Attachments:

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

  • Posts: 74542
  • Thank you received: 11497
  • MODERATOR
10 months 1 week ago #330598

Hi,

It's not possible for a plugin to add its information to the additional area.
However, it is possible to create new areas with its information.
To do that, you can implement the trigger onAfterOrderProductsListingDisplay(&$order, $viewName) in your plugin.
$order will contain the data of the current order and $viewName will contain the name of the view which in this case will be "order_back_show".
You can directly echo HTML in that function and it will be displayed between the products listing and the history listing on this page.

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

  • Posts: 12
  • Thank you received: 0
10 months 1 week ago #330649

Hi,

Is there any way to insert some data in $order object from onPaymentNotification and to access them in $order object in onAfterOrderProductsListingDisplay(&$order, $viewName) function, or any other way to access data from onPaymentNotification(&$statuses) to onAfterOrderProductsListingDisplay(&$order, $viewName) function.

Thanks.

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

  • Posts: 74542
  • Thank you received: 11497
  • MODERATOR
10 months 1 week ago #330658

Hi,

Sure. First you could create your own table and store your data there along with the order_id so that you could then read it later it using the order_id for reference.
Otherwise, you could also store your data in the order_payment_params column of hikashop_order like that:

$params = $order->order_payment_params;
$params->my_data = new stdClass();
$params->my_data->blabla = 'text text';
$orderObject = new stdClass();
$orderObject->order_id = $order->order_id;
$orderObject->order_payment_params = $params;
$class = hikashop_get('class.order');
$class->save($orderObject);

In onAfterOrderProductsListingDisplay you should directly have your text in the variable $order->order_payment_params->my_data->blabla

The following user(s) said Thank You: lirimimeri

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

Time to create page: 0.059 seconds
Powered by Kunena Forum