Hello,
Changing an order is not possible when a product is out of stock. What happens is that someone orders 2 iphones(3 in stock), the order is added to sales and orders. But when I want to change the address of the order it is not possible. All the time the system tells me that the product is not available. I find this strange because the order is already done and I am wondering what the stock has to do with changing an address in the order.
Also is the system sending an email to the custmer with every change, is there a way to enable this because I only want to send an update if I want to and not all the time, that will make customers angry.
Thanks
Changing an order is not possible when a product is out of stock. What happens is that someone orders 2 iphones(3 in stock), the order is added to sales and orders. But when I want to change the address of the order it is not possible. All the time the system tells me that the product is not available. I find this strange because the order is already done and I am wondering what the stock has to do with changing an address in the order.
Also is the system sending an email to the custmer with every change, is there a way to enable this because I only want to send an update if I want to and not all the time, that will make customers angry.
Thanks
I do not have 2 windows open at the same time.
I do not understand what you mean with refresh. I just open the order, see the order info, click next, on the product page and it gives me the system message that there are not enough available products, I click next etc. but when I want to save it does nothing because I have the system message and I only can cancel or go back to orders list. Why does i give me the system message, the order is already made!!!
I do not understand what you mean with refresh. I just open the order, see the order info, click next, on the product page and it gives me the system message that there are not enough available products, I click next etc. but when I want to save it does nothing because I have the system message and I only can cancel or go back to orders list. Why does i give me the system message, the order is already made!!!
Because the system does't void order when start edit, but after allows you to save.
I think that the right way should be:
- when you start edit order, the system void the order (add stock, unconfirm all totals)
- you save the order, the system put all back (remove stock, confirm all totals)
- if you don't save the order, the order remain voided
I think that the right way should be:
- when you start edit order, the system void the order (add stock, unconfirm all totals)
- you save the order, the system put all back (remove stock, confirm all totals)
- if you don't save the order, the order remain voided
I find this a big problem and huge bug. Today I had an order and the house number not filled in. I clicked on edit order, filled in the house number and went to the end to save the order. After I cclicked save I checked the amount of product in my stock and it was not right. What happend was that the order took 1 product of my stock and when I edit the order the system added 1 product to my stock again while the order was still there. If this is the case I need to check my stock every day, not good
If everything is set right, when you edit the order system firstly:
and then after is saved
I think the stock is calculated correctly, but the first part should be done at the moment when you start editing the order. This way you start editing with products in stock.
Code: Select all
$this->addOrderHistory($order_id, 0);
// Restock
$product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'");
foreach($product_query->rows as $product) {
$this->db->query("UPDATE `" . DB_PREFIX . "product` SET quantity = (quantity + " . (int)$product['quantity'] . ") WHERE product_id = '" . (int)$product['product_id'] . "' AND subtract = '1'");
$option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . (int)$product['order_product_id'] . "'");
foreach ($option_query->rows as $option) {
$this->db->query("UPDATE " . DB_PREFIX . "product_option_value SET quantity = (quantity + " . (int)$product['quantity'] . ") WHERE product_option_value_id = '" . (int)$option['product_option_value_id'] . "' AND subtract = '1'");
}
}
Code: Select all
$this->model_checkout_order->addOrderHistory($order_id, $order_status_id);
// Stock subtraction
$order_product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'");
foreach ($order_product_query->rows as $order_product) {
$this->db->query("UPDATE " . DB_PREFIX . "product SET quantity = (quantity - " . (int)$order_product['quantity'] . ") WHERE product_id = '" . (int)$order_product['product_id'] . "' AND subtract = '1'");
$order_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . (int)$order_product['order_product_id'] . "'");
foreach ($order_option_query->rows as $option) {
$this->db->query("UPDATE " . DB_PREFIX . "product_option_value SET quantity = (quantity - " . (int)$order_product['quantity'] . ") WHERE product_option_value_id = '" . (int)$option['product_option_value_id'] . "' AND subtract = '1'");
}
}
It seems there is an item on github about this matter, but did you managed to solve it by using the code above?
This is the link to the github item: https://github.com/opencart/opencart/is ... -174064591
This is the link to the github item: https://github.com/opencart/opencart/is ... -174064591
Hi,
I'm stuck with the same problem. In my store we constantly have products with low stock and editing order is a nightmare, I must go to the product to add some stock than go back to the order editing and so on...
Does anybody found any solution?!
I'm stuck with the same problem. In my store we constantly have products with low stock and editing order is a nightmare, I must go to the product to add some stock than go back to the order editing and so on...
Does anybody found any solution?!
OpenCart SEO Services
http://tomeda.bg
OC version?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I am surprised to see that in 2020 with OC 2.3.0.2 this is still an issue.
I just came to report the exact same thing happening but found numerous threads. I too went to simply change the shipping address on an order but because the customer had bought the last of the stock of a product, the change wasn't committed because there isn't sufficient stock.
I just came to report the exact same thing happening but found numerous threads. I too went to simply change the shipping address on an order but because the customer had bought the last of the stock of a product, the change wasn't committed because there isn't sufficient stock.
I'm not sure a video is necessary. When I go to edit an order, I click continue from tab 1 and am taken to tab 2 where I get the following:
https://pasteboard.co/IS418Jz.png
Even though I can continue to Tab 3 and change the delivery address, the changes aren't saved because of this quantity issue.
https://pasteboard.co/IS418Jz.png
Even though I can continue to Tab 3 and change the delivery address, the changes aren't saved because of this quantity issue.
The provided screenshot link above is not working as it even leads to a false-positive infection page.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
That's strange, I get no such errors or warnings. What about the following:
https://snipboard.io/huejHm.jpg
https://snipboard.io/huejHm.jpg
You have upload on forum
Attachments
12e2f3a9-a79c-43f6-969f-8addda37702f.png (29.01 KiB) Viewed 3692 times
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Yes, this one works better. I would, then, suggest to remove the previous link you posted above for security purposes.rhorne wrote: ↑Tue Jan 28, 2020 10:25 pmThat's strange, I get no such errors or warnings. What about the following:
https://snipboard.io/huejHm.jpg
As for the out of stock, the thing is that the products are being pulled from the same location whether it's from the API in the admin sales orders or from the catalog product page in order to maintain the stock levels and the service levels between store owners and the customers. If you're looking for a push order strategy based on a stock level that cannot be guaranteed to the customer, then you'd be affecting the utility of the product value when using the API orders as compared to the catalog product page.
In order to rectify that issue, since each stores also have their own settings defined from the admin systems settings, the stock levels would need to be overwritten individually on the stock levels whenever the API is used but, even there, manufacturers and products being copied categorically could also exclude those remarks as well as store owners feeding their products with their stocks via a service provider where this method can also become quite complex.
Therefore, by creating a product group page (which I believe one or multiple extensions on the Marketplace already exists for this) could create part of the solution where the stock levels could be re-balanced since product groups could also involved using the APIs as an additional group. This way, the product page and the checkout process from the catalog-end side won't be interfered with any customers whether it's for guests or registered customers and affiliates.
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 320 guests