Stock levels not verified on confirm checkout

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Stock levels not verified on confirm checkout

Postby info@.....com » Tue Dec 02, 2014 4:59 pm

Hello,
We are using v2.0.273.021214 of OPC and it does not appear that the stock levels are validated when a customer clicks the 'Confirm Checkout' button of the OPC form. Since potential customers could be adding available stock to the cart until ordered, this causes orders to be received when there are no longer items in stock.

This scenario is created by following these steps:
1) Product A has 5 items in stock.
2) Customer 1 adds Product A to their cart with quantity of 5.
3) Customer 2 adds Product A to their cart with quantity of 5.
4) Customer 1 uses OPC to checkout which reduces the orderable quantity to 0.
5) Customer 2 uses OPC to checkout. *Here the customer should not be allowed to checkout since Product A has 0 quantity.

We verified that using Virtuemart v2.6.12.2 native checkout process that when clicking on "Confirm Checkout" in step 5 above, that the stock level is verified and the order can not be continued without lowering or removing the out-of-stock item(s). Can you verify if OPC is setup to check in stock when finalizing the checkout?

Thanks,
Chuck
info@.....com
 
Posts: 10
Joined: Mon Nov 25, 2013 8:08 pm

Re: Stock levels not verified on confirm checkout

Postby admin » Thu Dec 04, 2014 6:53 pm

hello Chuck, i will check this and fix it.

so as far as i understand you are using vm2.6.12.2

opc is using cart override for checkout here:
\components\com_onepage\overrides\cart_override.php

which uses exactly same function as used here:
\vm2onj25\components\com_virtuemart\helpers\cart.php

i will be testing this and see what can be done. maybe i can block the checkout even before the submit with the alert message that one of the items got out of the stock.

please note that the stock handling depends on the order status which tells VM if to subtract the quantity or not, but i guess you already got this all configured.

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Stock levels not verified on confirm checkout

Postby info@.....com » Fri Dec 12, 2014 9:56 pm

Thanks for the reply Stan. Yes we are using vm2.6.12.2.

Yes the stock handling appears to be working properly where it is reducing the Booked quantity after checkout and order status is Confirmed. Then subtracting Booked and In Stock quantities when the order is Shipped. The problem seems to be that the quantity checking is not being handled when Confirm Checkout is triggered from OPC.
info@.....com
 
Posts: 10
Joined: Mon Nov 25, 2013 8:08 pm

Re: Stock levels not verified on confirm checkout

Postby info@.....com » Mon Jan 05, 2015 4:19 pm

Hi Stan - Were you able to determine the issue with not checking stock level when confirming the checkout through OPC?
info@.....com
 
Posts: 10
Joined: Mon Nov 25, 2013 8:08 pm

Re: Stock levels not verified on confirm checkout

Postby admin » Fri Jan 09, 2015 1:49 pm

hello, opc uses own order handler (cart controller), which is a copy of VM's cart controller with added features. i will check on this, it's located in /components/com_onepage/overrides/cart_overrride.php

the order is usually processed with:
- the Pending status (at the beggining) has no influence on stock if thus configured in VM's order statuses
- the Confirmed (or else) status if configured in VM changes the stock, but this status is given by payment methods after the order is saved.

the question now is - when should opc check for stock levels and what is the appropriate action.

for next opc version within next weeks we are going to add:
- product coloring into OPC if the product is in stock (green), low level stock (blue), or out of stock (red)
- new checkbox for "ship only whole order" -> now what would be the shipping if the order has to be separated...

the question for you is:

what should opc do if product stock is 10 pieces and :
- customer ordered 11
- customer ordered 10
- customer ordered 9 (which could be a low level stock warning... )

when should opc redirect the customer back to the cart / separated order into instock products and out of stock products / or give any other information to customer.

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Stock levels not verified on confirm checkout

Postby info@.....com » Fri Jan 09, 2015 2:45 pm

Hi Stan and thanks for the analysis.

For the purpose of several of my customers they would want the store to stop any order that is submitted with quantity order greater than what is in inventory (In Inventory = product in stock - booked products). Similar to the native VM checkout, the customer should be alerted to the 'out of stock' products and require them to remove the item or reduce the quantity down to the available number.

The product coloring would be great bonus for in stock and out of stock products but my opinion is the 'low level' color may confuse the customer and not mean much since the 'low level' can vary based on store owner. These are just my thoughts and you may have other customers who may like the feature.

For me there is no need to worry about separating the order. My store owners simply want to disallow an order to be submitted until the quantities are adjusted to what is available in stock.

In your example the following should happen if customer clicks on 'Confirm Checkout' with product of 10 available (calculated as 'in stock quantity - booked quantity'):
- customer ordered 11: The customer should return to the cart with a message (popup or message box at top of screen) that says something like "Your order can not be processed due to the following product stock issues: 'Product Name' has 10 available and you have 11 in the cart. Please update the quantity or remove the item from your cart." Displaying these out of stock products in the cart with red color would be a bonus.
- customer ordered 10: Order processes fine.
- customer ordered 9: Order processes fine.

Chuck
info@.....com
 
Posts: 10
Joined: Mon Nov 25, 2013 8:08 pm

Re: Stock levels not verified on confirm checkout

Postby info@.....com » Sat Jan 24, 2015 3:40 pm

Hi Stan,
I installed the latest version 2.0.279 which I see has the stock level color coding added. Therefore I installed and tested the problem I described in this post. The problem that the order was allowed to be submitted when products were not in stock still exists. I enabled all the color options (which worked fine) but the order could still be submitted.

Thanks,
Chuck
info@.....com
 
Posts: 10
Joined: Mon Nov 25, 2013 8:08 pm

Re: Stock levels not verified on confirm checkout

Postby admin » Tue Jan 27, 2015 8:27 pm

hello Chuck,
the coloring and the "after checkout" OPC's tab are two different features now -> pls configre the section at the opc's after checkout tab.

are you using any sort of parent/child or other type of stock handling ? if yes, maybe i could customize the feature to meet your needs even further.

pls see this section as well:
Image

today i found a small bug in the coloring feature, so i am going to release an update for this.

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Stock levels not verified on confirm checkout

Postby info@.....com » Tue Jan 27, 2015 9:23 pm

Thanks Stan. I had not looked under the 'After Checkout' tab. I have tested the feature and can validate that the orders can not be submitted if there is not enough stock available at the time the shopper is checking out with products in their cart prior to the out-of-stock condition.

I appreciate your work to add this verification of the stock at checkout as well as the bonus stock color feature.
info@.....com
 
Posts: 10
Joined: Mon Nov 25, 2013 8:08 pm

Re: Stock levels not verified on confirm checkout

Postby admin » Thu Jan 29, 2015 1:13 pm

hello, you are very welcome, we had discovered a small bug in the coloring system (the quantity larger than available) was not colored and this is fixed with the latest opc release at the download section. if needed, you can override the colors with CSS when using !important. we also added a product's name class so you can color the link as well. (it would be too complicated now to color whole row)

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 2