Post by cool20061988 » Sun Feb 21, 2016 7:59 pm

I'm using open cart version 2.1.0.2.

I'm trying to buy the same product using 2 browser.
The product stock is 10. Buyer A is trying to buy 10 and buyer B is 10.
Then I checked out both of them.
I finished the order of buyer A and then I tried to continue (click "continue" button) with buyer B but I was redirected to "view cart" (opencart is working properly).

Then I tried with the condition where both buyers only need to click "confirm order" button (I reset the stock).

I clicked the button for buyer A and the order succeed.
Then I clicked the button for buyer B and the order succedd too (opencart not check stock when confirm order). The stock is minus.

Can anyone tell me how to fix it?
I think I only need to copy the query when button "continue" clicked (check stock part) and copy it to "confirm order" but I can't find the file.

Thank you.

Newbie

Posts

Joined
Sun Feb 21, 2016 6:30 pm

Post by cool20061988 » Mon Feb 22, 2016 8:09 am

I made a mistake. The title should be "Stock is not checked when confirm order".

Newbie

Posts

Joined
Sun Feb 21, 2016 6:30 pm

Post by Burt65 » Mon Feb 22, 2016 10:27 am

That's an interesting test you are doing there...

OC normally remove the stock based on what you have selected in:

Setting / Options / Processing Order Status...

I don't know if this is what you are after...

Over 95% of all computer problems can be traced back to the interface between the keyboard and the chair...


User avatar
Active Member

Posts

Joined
Mon Nov 18, 2013 3:23 pm
Location - Oz

Post by cool20061988 » Mon Feb 22, 2016 12:39 pm

Burt65 wrote:That's an interesting test you are doing there...

OC normally remove the stock based on what you have selected in:

Setting / Options / Processing Order Status...

I don't know if this is what you are after...
The processing order status is set correctly.
OC checks the stocks in every step during check out except at the last step (when "confirm order" clicked).

The problem occured in this condition:
1. The buyer has reached the last step in check out (only need to click "confirm order", in this condition the stock is >= order) to finish, and
2. Another buyer buy the same product and finish the order before the buyer in no 1 (the stock become < order), and
3. The buyer in no 1 finish the order (the order success, the stock become minus).

The problem don't occur if the buyer hasn't reached the final step in check out. For example: if the buyer click " continue" in payment method, OC will redirect the buyer to "view cart" page because the stock is < order.

Newbie

Posts

Joined
Sun Feb 21, 2016 6:30 pm

Post by Burt65 » Mon Feb 22, 2016 3:27 pm

So what you are saying is that if two people buy a product simultaneously and you have only 1 stock left, your stock goes negative after the purchase. Am I right?


I just did the same test and you are right. The stock goes negative...


You may want to report it here, just in case...

https://github.com/opencart/opencart/issues

Over 95% of all computer problems can be traced back to the interface between the keyboard and the chair...


User avatar
Active Member

Posts

Joined
Mon Nov 18, 2013 3:23 pm
Location - Oz

Post by cool20061988 » Mon Feb 22, 2016 4:37 pm

Burt65 wrote:So what you are saying is that if two people buy a product simultaneously and you have only 1 stock left, your stock goes negative after the purchase. Am I right?


I just did the same test and you are right. The stock goes negative...


You may want to report it here, just in case...

https://github.com/opencart/opencart/issues
Exactly... I have posted it at github but it's closed with answer that isn't solve the problem.

https://github.com/opencart/opencart/issues/3973

Newbie

Posts

Joined
Sun Feb 21, 2016 6:30 pm

Post by Burt65 » Mon Feb 22, 2016 4:53 pm

I just read Daniel answer and maybe there is some communication problem there. The first time I read your post I didn't understood you either. I mean is up to you, but maybe try again or give Daniel a link to this thread... I mean the chance of two customer buying the same product at the same time are remote, but it could happen...

Over 95% of all computer problems can be traced back to the interface between the keyboard and the chair...


User avatar
Active Member

Posts

Joined
Mon Nov 18, 2013 3:23 pm
Location - Oz

Post by cool20061988 » Mon Feb 22, 2016 5:24 pm

Burt65 wrote:I just read Daniel answer and maybe there is some communication problem there. The first time I read your post I didn't understood you either. I mean is up to you, but maybe try again or give Daniel a link to this thread... I mean the chance of two customer buying the same product at the same time are remote, but it could happen...
I reposted the problem and he closed it again.
https://github.com/opencart/opencart/issues/3978

Newbie

Posts

Joined
Sun Feb 21, 2016 6:30 pm

Post by Burt65 » Mon Feb 22, 2016 5:33 pm

That's interesting... You did explain the problem properly this time and you did everything you could. I have no idea of why...

Over 95% of all computer problems can be traced back to the interface between the keyboard and the chair...


User avatar
Active Member

Posts

Joined
Mon Nov 18, 2013 3:23 pm
Location - Oz

Post by cool20061988 » Mon Feb 22, 2016 5:55 pm


Newbie

Posts

Joined
Sun Feb 21, 2016 6:30 pm
Who is online

Users browsing this forum: No registered users and 5 guests