Forum
Problem with perch_shop_order_successful
If I use this code on my checkout:
perch_shop_checkout('manual', [
'status' => 'manual_order',
'return_url' => $return_url,
'cancel_url' => $cancel_url,
]);
The order will be added to the system with a status of Manual_order. However, on the return_url page, when I check for
if (perch_shop_order_successful()) { ...
It does not pass and goes to the unsuccessful else statement. (manual_order is an active status with a number of 101)
When I remove the 'status' => 'manual_order'
line, and get to the return_url, order _successful is checking correctly.
Am I doing something wrong? Does the order_successful function expect to find something that my status of manual_order is messing up?
Thanks, Monty
Have you checked the debug?
This is the debug on the the $return_url page:
I don't see anything out of the ordinary:
What is the order status of
108
?Manual_order
oh. So perch_shop_order_successful() specifically looks for Paid?
Yes, it looks for a status of
paid
.If you're doing a manual order, you know the status, so why do you need to check it?
Right. Got it