modifyOrder() not working

  • Posts: 5
  • Thank you received: 0
7 years 9 months ago #244668

Hello Hikashop Team.

I'm making a payment plugin integration. The only problem I have is that the function $this->modifyOrder($order_id, $this->payment_params->verified_status, true, true); is not working and therefore the order status is not update. I know the onPaymentNotification is working fine and I'm receiving the POST variables because I'm using $this->writeToLog("testx\n"); function and I can see that. So to check where was the problem I put the writeToLog fuction after each line in the onPaymentNotification function, and I verified that the writeToLog after the first modifyOrder function is not printing and also the other writeToLogs after this modifyOrder function. It is like the modifyOrder acts like a loop.
I would like your help with this.

Thank you.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
7 years 9 months ago #244672

Hi,

Without knowing the context we cannot provide you any useful answer.
Now, the "modifyOrder" function is working perfectly fine because that function is used by all the HikaShop plugins.

If you give the function an order id, it will update the order in the database (using the save function and it will call the triggers).
If you give the function an order object, it will update the object and let you perform the save afterwards.

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: 223
  • Thank you received: 26
  • Hikashop Business
3 years 11 months ago #318543

As a future info for me and others :P

To be able to use the function modifyOrder(), you need to extend hikashopPaymentPlugin.
So when you create your plugin, don't use

class PlgHikashopMyplugin extends JPlugin
do it like this
class PlgHikashopMyplugin extends hikashopPaymentPlugin

Last edit: 3 years 11 months ago by oxido.
The following user(s) said Thank You: nicolas

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

Time to create page: 0.059 seconds
Powered by Kunena Forum