But the update query is:
public function confirm($order_id, $order_status_id) {
Code: Select all
$this->db->query("UPDATE `order` SET confirm = '1' WHERE order_id = '" . (int)$order_id . "' AND order_status_id = '" . (int)$order_status_id . "'");
I believe it should be part of the SET so that you are updating the status and setting the status:
Code: Select all
$this->db->query("UPDATE `order` SET confirm = '1', order_status_id = '" . (int)$order_status_id . "' WHERE order_id = '" . (int)$order_id . "'");
I would think you would want:
Checkout_confirm
click "Confirm"
Ajax callback to create a "Pending" order with a confirm of 0
then goto payment site
get IPN/return
Update the "Pending" order to "Processing" with a confirm of 1
I'm not sure why you are confirming paypal orders with an ajax callback before the payment processor is even called.