Send sms when status is changed

Hey.

I have tried adding my sms code but havnt succeeded made it to work.

So can anyone help me where i should place my sms code to send sms when orderstatus is changed. And in what file.

Thanks

Jonas,

I've done basically the same thing, but only for new orders, and have placed the code in 
includes/entities/ent_order.inc.php
just before the second
$email = new ent_email();

Marc

Ah, ok. So if they pay with PayPal sms wont be sent when status is changed to payment received ?

If you're talking about LiteCart's order status, then yes. it's doable.  You just have to tie into the status change code.

Looking more closely at ent_order.inc.php, it appears that you could tie into the following code to trigger your SMS:


      if (!empty($this->previous) && ($this->data['order_status_id'] != $this->previous['order_status_id'])) {
        if (!empty(reference::order_status($this->data['order_status_id'])->notify)) {
          $this->send_email_notification();
        }
      }```

Which SMS provider do you use?

yes, it worked, thanks a lot.
I did like this

$this->send_email_notification();
} // <-- closed it here
if ($current_order_status['id'] == 3 && $current_order_status['id'] != $previous_order_status['id']) { // added this

My sms code goes here

This thread has been closed due to long inactivity. Posting to it is not possible.
View code on GitHub