customer notification not send after status update

  • Posts: 326
  • Thank you received: 24
1 day 8 hours ago #372154

-- url of the page with the problem -- : www.cultuuroudenbosch.nl/
-- HikaShop version -- : 6.5.0
-- Joomla version -- : 6.1.1
-- PHP version -- : 8.4

Hi,
We are using RO Payments for handling the payments and the return to HikaShop.

In here we set the status of the order to "Shipped" because it's about digital tickets.
I have updated the setting to always notify the customer when updating an order.

The problem is that this e-mail is not send when the status is updated via RO Payments but is when done manually.
Checked with Roland and he tells me that when the test are done and the statuses meet the requirements he execute this code :
$history->notified = 1;

Now can you help us figure out if anything is wrong with this approach?

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

  • Posts: 85686
  • Thank you received: 14047
  • MODERATOR
1 day 5 hours ago #372156

Hi,

Setting notified = 1 is the right idea, the customer status email is gated on that flag, but it only goes out if the call to modifyOrder is done in a way that actually saves the order. Two things need to be true, and the second one is the most likely reason it works manually but not through RO Payments.

1. The history object (with notified = 1) has to be passed as the third argument of modifyOrder, for example $this->modifyOrder($order_id, 'Shipped', $history). HikaShop rebuilds the history record from that argument, so anything set directly on $order->history is ignored. The simplest equivalent is to pass true as the third argument:

$this->modifyOrder($order_id, 'Shipped', true)

true maps straight to notified = 1.

2. modifyOrder has to be called with the integer order id, not the order object. This is the important one. modifyOrder only saves the order (and therefore only sends the customer email) when the first argument is an id and not an object. Passing the order object is meant for the order creation flow, where the order is saved later by the controller. For a status change on an existing order, passing the object means no save happens, so the customer notification is never sent. That matches what you see: the manual backend update sends the mail, the RO Payments update does not.

So could you ask Roland to check that he calls modifyOrder with the integer order id (not the order object), and passes the notification as the third argument (true, or the history object with notified = 1). With that, the Shipped status email will be sent like it is for a manual update.

One side note so there is no confusion: the email parameter and the "payment notification email" setting control a separate notification that goes to the shop owner, not to the customer. The customer status email is the notified flag on the history, which is what you already identified.

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

  • Posts: 270
  • Thank you received: 37
  • Hikamarket Multivendor Hikaserial Subscription Hikashop Business
1 day 5 hours ago #372162

useless response from me after Nicolas' message, that's why I deleted it, sorry :whistle:

Last edit: 1 day 5 hours ago by oxido. Reason: useless response from me after Nicolas' message

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

Time to create page: 0.068 seconds
Powered by Kunena Forum