motion2082 wrote: ↑Mon Apr 29, 2019 11:37 am
Hey guys,
I would like to check my order status to see if it's "processing"
When I use the following it won't detect the order is processing.
Is my IF statement incorrect?
Using in the model file.
Code: Select all
if($order_info['status'] == 'processing'){
$data['show_unpaid'] = false;
$data['show_paid'] = true;
} else {
$data['show_paid'] = false;
$data['show_unpaid'] = false;
}
it is not correct because statuses comes not as words but as id of the status, the ones you define under admin (system>localisation > order statuses)
By default processing status (if you didnt modified anything) is id = 2
order_status_id and there is no 'status' column it is order_status_id
so based on your requirements:
Code: Select all
if ($order_info['order_status_id'] == 2) {
$data['show_unpaid'] = false;
$data['show_paid'] = true;
} else {
$data['show_paid'] = false;
$data['show_unpaid'] = false;
}