Hi there,
I need a bit Support in understand the order statuses. I set the standard statuses for Processing and Completed ("Processing" and "Completed").
Now, I understand, once a checkout is done, the status is set to "Processing", which subtracts the stock and applies any coupons etc. - When I set the status to complete, then download products can be downloaded. For physical products it doesn't have any implications.
Now, I do have many statuses in between (shipped, packing, packed, waiting for payment, checking for product etc.) - As far as I understand in the code, any status other than the processing and complete status will restock the products, i.e. cancel the order and make the product (quantities) available for sale. That is obviously not, what I want.
Do I have to check all statuses, which belong to my order fulfillment process in the settings tab to prevent OC from restocking the products?
Another question is, how OC handles returns. If a return arrives in the system, how does OC connects it to the orders and the products in terms of restocking and sales reports?
Thanks,
schiggi
I need a bit Support in understand the order statuses. I set the standard statuses for Processing and Completed ("Processing" and "Completed").
Now, I understand, once a checkout is done, the status is set to "Processing", which subtracts the stock and applies any coupons etc. - When I set the status to complete, then download products can be downloaded. For physical products it doesn't have any implications.
Now, I do have many statuses in between (shipped, packing, packed, waiting for payment, checking for product etc.) - As far as I understand in the code, any status other than the processing and complete status will restock the products, i.e. cancel the order and make the product (quantities) available for sale. That is obviously not, what I want.
Do I have to check all statuses, which belong to my order fulfillment process in the settings tab to prevent OC from restocking the products?
Another question is, how OC handles returns. If a return arrives in the system, how does OC connects it to the orders and the products in terms of restocking and sales reports?
Thanks,
schiggi
Not only under the admin settings but also under the payment modules to where the payment transactions are activated for your customers during checkout.Do I have to check all statuses, which belong to my order fulfillment process in the settings tab to prevent OC from restocking the products?
This feature might exist as an extension. If there are no extension that can be relatively found, this idea can always be posted under the feature requests section of the forum.Another question is, how OC handles returns. If a return arrives in the system, how does OC connects it to the orders and the products in terms of restocking and sales reports?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Thank you for the very quick reply. That makes the whole process a bit clearer.
One thing, that bugs me or I don't understand the behaviour, is the order edit. Atm, after every edit of the order (correcting wrong customer data like name or address), the admins and the customer gets a new confirmation email. Since I can edit an order up to 10x times, the customer and me are getting 10 emails, which is obviously annoying.
How to change the behaviour? Is that intended or a bug/misusage from my side?
One thing, that bugs me or I don't understand the behaviour, is the order edit. Atm, after every edit of the order (correcting wrong customer data like name or address), the admins and the customer gets a new confirmation email. Since I can edit an order up to 10x times, the customer and me are getting 10 emails, which is obviously annoying.
How to change the behaviour? Is that intended or a bug/misusage from my side?
This seems to be a persistent bug which was also not fixed into the latest version of Opencart either. Thanks for tracking this.schiggi wrote:Thank you for the very quick reply. That makes the whole process a bit clearer.
One thing, that bugs me or I don't understand the behaviour, is the order edit. Atm, after every edit of the order (correcting wrong customer data like name or address), the admins and the customer gets a new confirmation email. Since I can edit an order up to 10x times, the customer and me are getting 10 emails, which is obviously annoying.
How to change the behaviour? Is that intended or a bug/misusage from my side?
In order to resolved this issue, in your catalog/model/checkout/order.php file,
find:
Code: Select all
$mail->send();
// Admin Alert Mail
Code: Select all
if ((!empty($this->session->data['order_id'])) || (empty($this->session->data['order_id']) && $notify)) {
$mail->send();
}
// Admin Alert Mail
find:
Code: Select all
$mail->send();
// Send to additional alert emails
$emails = explode(',', $this->config->get('config_alert_email'));
foreach ($emails as $email) {
if ($email && filter_var($email, FILTER_VALIDATE_EMAIL)) {
$mail->setTo($email);
$mail->send();
}
}
Code: Select all
if ((!empty($this->session->data['order_id'])) || (empty($this->session->data['order_id']) && $notify)) {
$mail->send();
}
// Send to additional alert emails
$emails = explode(',', $this->config->get('config_alert_email'));
foreach ($emails as $email) {
if ($email && filter_var($email, FILTER_VALIDATE_EMAIL)) {
$mail->setTo($email);
if ((!empty($this->session->data['order_id'])) || (empty($this->session->data['order_id']) && $notify)) {
$mail->send();
}
}
}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Thanks, that indeed is a another problem. Thanks for the fix. Will implement that as an ocmod.
What I actually meant with my previous post was the real order edit. So not order status edit, but order edit.
From the function edit_order in catalog/model/checkout/order.php, I can see, that the order is voided first and the order status set to 0:
I am not sure, why that has to be done. Could you explain me, why we need to void it first in order to edit it?
As the order_status_id is set to 0, later through the API (catalog/controller/api/order.php) the order_status is set to the status defined during the order edit form in the backend admin:
As the order_status has been set to 0 in the previous order_edit function, the following lines are triggered in addOrderHistory (Line 383)
...and the customer/admin gets the order confirmation.
That might make sense, if the ordered products have been changed or anything regarding the total sum. But for simple editing of spelling mistakes or assigning customers to customer groups or anything, then it would be great to have the choice, if to send a confirmation email or not.
Through an event, I could add back the original order status in order_edit, but I am not sure, why voiding of order has been added in the first place. Can you please explain that to me?
EDIT: Through your modifications, obviously the same result would be achieved as order edits don't have a $notify var as far as I can see. Still curious about the voiding of order.
What I actually meant with my previous post was the real order edit. So not order status edit, but order edit.
From the function edit_order in catalog/model/checkout/order.php, I can see, that the order is voided first and the order status set to 0:
Code: Select all
// Void the order first
$this->addOrderHistory($order_id, 0);
As the order_status_id is set to 0, later through the API (catalog/controller/api/order.php) the order_status is set to the status defined during the order edit form in the backend admin:
Code: Select all
//Line 676
$this->model_checkout_order->addOrderHistory($order_id, $order_status_id);
Code: Select all
// If order status is 0 then becomes greater than 0 send main html email
if (!$order_info['order_status_id'] && $order_status_id) {...}
That might make sense, if the ordered products have been changed or anything regarding the total sum. But for simple editing of spelling mistakes or assigning customers to customer groups or anything, then it would be great to have the choice, if to send a confirmation email or not.
Through an event, I could add back the original order status in order_edit, but I am not sure, why voiding of order has been added in the first place. Can you please explain that to me?
EDIT: Through your modifications, obviously the same result would be achieved as order edits don't have a $notify var as far as I can see. Still curious about the voiding of order.
Last edited by schiggi on Fri Aug 05, 2016 4:58 am, edited 1 time in total.
Either you decide to edit the order status of the main order or the order statuses related to the order will still be heading to the addOrderHistory method from the mentioned path and file above. Implementing the fix above will definitely fix the issue which was already addressed before for prior versions of Opencart.schiggi wrote:Thanks, that indeed is a another problem. Thanks for the fix. Will implement that as an ocmod.
What I actually meant with my previous post was the real order edit. So not order status edit, but order edit.
From the function edit_order in catalog/model/checkout/order.php, I can see, that the order is voided first and the order status set to 0:I am not sure, why that has to be done. Could you explain me, why we need to void it first in order to edit it?Code: Select all
// Void the order first $this->addOrderHistory($order_id, 0);
As the order_status_id is set to 0, later through the API (catalog/controller/api/order.php) the order_status is set to the status defined during the order edit form in the backend admin:As the order_status has been set to 0 in the previous order_edit function, the following lines are triggered in addOrderHistory (Line 383)Code: Select all
//Line 676 $this->model_checkout_order->addOrderHistory($order_id, $order_status_id);
...and the customer/admin gets the order confirmation.Code: Select all
// If order status is 0 then becomes greater than 0 send main html email if (!$order_info['order_status_id'] && $order_status_id) {...}
That might make sense, if the ordered products have been changed or anything regarding the total sum. But for simple editing of spelling mistakes or assigning customers to customer groups or anything, then it would be great to have the choice, if to send a confirmation email or not.
Through an event, I could add back the original order status in order_edit, but I am not sure, why voiding of order has been added in the first place. Can you please explain that to me?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 144 guests