Jump to content

Duplicate Emails for Order State Updation via Webservice


Recommended Posts

When trying to update an Order, an email is sent out to the buyer irrespective of the 'current_state' value. For example, if I send this : 


<?xml version="1.0" encoding="utf-8"?>
        <payment>Bank wire</payment>
So, here <current_state> is 4 and its already 4 in the database, in other words I didn't change it. But an email is sent whereas its expected to NOT send an email if the state does not change. 
Please let me know if I am doing something wrong.
Edited by vikas.programmer (see edit history)
Link to comment
Share on other sites

Well, I found this code. It emails the user without checking of new 'current_state'


public function setCurrentState($id_order_state, $id_employee = 0)
if (empty($id_order_state))
return false;
$history = new OrderHistory();
$history->id_order = (int)$this->id;
$history->id_employee = (int)$id_employee;
$history->changeIdOrderState((int)$id_order_state, $this);
$res = Db::getInstance()->getRow('
SELECT `invoice_number`, `invoice_date`, `delivery_number`, `delivery_date`
FROM `'._DB_PREFIX_.'orders`
WHERE `id_order` = '.(int)$this->id);
$this->invoice_date = $res['invoice_date'];
$this->invoice_number = $res['invoice_number'];
$this->delivery_date = $res['delivery_date'];
$this->delivery_number = $res['delivery_number'];

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...