Post by Qphoria » Fri Mar 27, 2009 10:09 pm

When using the confirm function in catalog/model/checkout/order.php, you pass the order_id and what I assume would be the order_status_id that you want the order to be.

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 . "'");
Which means, it is expecting the order_status_id to be a certain value or it won't update.

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 . "'");
To be honest, the update/confirm functions seem a bit redundant.. why not just include a confirm flag in the update function as one of the optional arguments. I mean it looks like you want the confirm to only trigger when the status is a certain status, but I dont really see the reasoning. I dont really understand the whole confirm ajax call either..

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.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Daniel » Sat Mar 28, 2009 4:37 am

Your right this bit of code is wrong:

Code: Select all

$this->db->query("UPDATE `order` SET confirm = '1', order_status_id = '" . (int)$order_status_id . "' WHERE order_id = '" . (int)$order_id . "'");
The AJAX confirm is to stop orders being lost if for some reason the callback does not work. I know you said in another post that IPN is PayPals baby, but some servers block ports up. I've had people complain about godday hosting not working with paypal.

http://www.paypaldeveloper.com/pdn/boar ... ge.id=1607

There are other hosts that do other things that stop paypals IPN working.

Orders with a confirm of 0 will not show in the admin. I needed to find a way for the orders to be stored until they where confirmed. Orders with a confirm status of 0 are also deleted after 1 month.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by Qphoria » Sat Mar 28, 2009 4:45 am

Yea after a little more looking into It.. I get it now. Tho I would think just using the update function with an optional confirm flag would suffice.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Daniel » Sat Mar 28, 2009 5:02 am

ok fixed!

Thanks for pointing that out.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm
Who is online

Users browsing this forum: No registered users and 10 guests