Post by Davx » Tue Sep 13, 2016 7:26 pm

Hey all,

Not sure if I'm missing something here but had an order for an out of stock item, was trying to work out how it happened....so went through the process a few times on a vanilla install of 2.3.0.2.

Here's the scenario:

Product - Iphone
Stock - 1 Unit
Product Options - More than one product option (stock set to 0, subtrack stock set to no)

So a customer can add the Iphone to his cart multiple times, using different options, and then checkout.

The stock is then changed to -1 Units.

I've had a look around to see if I'm missing something and get that Opencart will not update the stock until the order is set to a certain status defined in the admin.

I'm only guessing as haven't looked at the code yet but the stock check probably loops through each item in the basket, as the product is added as another line with the option it passes the check.

Newbie

Posts

Joined
Tue Mar 20, 2012 1:00 am

Post by Davx » Wed Sep 14, 2016 3:22 am

....quick ocmod that adds another check (totals quantity for each product in cart, then checks against main stock level).

The bug affects all fields, this would be a good example:
If you were running a Trophy Shop and offered engraving, lets say you add a text field to your product for the engraving.

You have 20 Trophies in stock, someone needs 30 trophies (the same style for arguments sake) for an event so adds 15 to the cart with the text field as "Well done coming first!" they then adds the same trophy to their cart with the engraving "Unlucky you came last!".

They then checkout with 30 trophies, when you only had 20 in stock.

Hopefully this will save someone the hassle of having to explain why an order can't be fulfilled! :)

Newbie

Posts

Joined
Tue Mar 20, 2012 1:00 am
Who is online

Users browsing this forum: No registered users and 14 guests