Jump to content

Edit History

Geoc112

Geoc112


Solved

Hello, i am using a custom php script that generates the tracking number for an order and changes the order status to Shipped. How can i also make to send the shipped themplate email like when i manually change the status to shipped for BO.

This is my code

	$objOrder = new Order($id_comanda);
	$history = new OrderHistory();
	$history->id_order = (int)$objOrder->id;
	$history->changeIdOrderState(4, (int)($objOrder->id));
	$history->id_employee = 3;
	$link->query("INSERT INTO ps_order_history (id_employee, id_order, id_order_state, date_add) VALUES ('3', '$id_comanda', '4', NOW());");

Coming back with an edit: I solved my problem by replacing the last line with $history->addWithemail(true);

Geoc112

Geoc112

Hello, i am using a custom php script that generates the tracking number for an order and changes the order status to Shipped. How can i also make to send the shipped themplate email like when i manually change the status to shipped for BO.

This is my code

	$objOrder = new Order($id_comanda);
	$history = new OrderHistory();
	$history->id_order = (int)$objOrder->id;
	$history->changeIdOrderState(4, (int)($objOrder->id));
	$history->id_employee = 3;
	$link->query("INSERT INTO ps_order_history (id_employee, id_order, id_order_state, date_add) VALUES ('3', '$id_comanda', '4', NOW());");

Coming back with an edit: Would it work if i insert $history->addWithemail(true); at the end ? Can't test it right now.

Geoc112

Geoc112

Hello, i am using a custom php script that generates the tracking number for an order and changes the order status to Shipped. How can i also make to send the shipped themplate email like when i manually change the status to shipped for BO.

This is my code

	$objOrder = new Order($id_comanda);
	$history = new OrderHistory();
	$history->id_order = (int)$objOrder->id;
	$history->changeIdOrderState(4, (int)($objOrder->id));
	$history->id_employee = 3;
	$link->query("INSERT INTO ps_order_history (id_employee, id_order, id_order_state, date_add) VALUES ('3', '$id_comanda', '4', NOW());");

 

×
×
  • Create New...