VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: coolmango on April 01, 2020, 06:51:03 AM

Title: Stock inventory not changing affter purchase
Post by: coolmango on April 01, 2020, 06:51:03 AM
Hi Guys

Joomla 3 VM 3

When a shopper has bought a product the stock amount has not changed.
Eg: A shopper bought 1 product, the only 1 in stock, after the transaction was completed the inventory still listed 1 product left instead of 0. Checked again next day and it still hadn't changed.
My client says this has happened a few times though I'm not sure if it is constanly happening.

Any clues why this would be?

cheers
kim
Title: Re: Stock inventory not changing affter purchase
Post by: AH on April 01, 2020, 10:08:48 AM
Check what the order status does to stock

It should be configured to remove on the paid order status

http://docs.virtuemart.net/manual/configuration-menu/order-statuses.html (http://docs.virtuemart.net/manual/configuration-menu/order-statuses.html)

and

http://docs.virtuemart.net/manual/configuration-menu/order-status-edit.html (http://docs.virtuemart.net/manual/configuration-menu/order-status-edit.html)
Title: Re: Stock inventory not changing affter purchase
Post by: coolmango on April 02, 2020, 02:14:01 AM
Hi A

Thanks for that.

I discovered that COM_VIRTUEMART_ORDER_STATUS_COMPLETED was set to 'is reserved' and changed to 'is completed'.
I'm assuming that should do the trick.

cheers
kim
Title: Re: Stock inventory not changing affter purchase
Post by: AH on April 02, 2020, 09:53:50 AM
As long as you have the the other order statuses set correctly based on your work flow

i do not understand "is completed"

I only know of three stock handling options as shown in the documentation I posted urls for

This may be a bit of guidance:

any status that could move stock out of your business i.e. prior to being shipped "is reserved"
any status that moves stock out of your business to "is removed"
any status that returns stock into your business to "is available"

Based on the above if this is a payment option i would set "is reserved"
Title: Re: Stock inventory not changing affter purchase
Post by: GJC Web Design on April 02, 2020, 10:55:31 AM
and to add to the above once the order is shipped you would choose a status that gave  "is removed"
Title: Re: Stock inventory not changing affter purchase
Post by: AH on April 02, 2020, 12:49:13 PM
Quoteand to add to the above once the order is shipped you would choose a status that gave  "is removed"

I guess I was not specific enough :-)

Quoteany status that moves stock out of your business to "is removed"
Title: Re: Stock inventory not changing affter purchase
Post by: GJC Web Design on April 02, 2020, 14:25:16 PM
AH - Glad you "manned up" and admitted the errors of your ways...
Title: Re: Stock inventory not changing affter purchase
Post by: AH on April 02, 2020, 18:38:36 PM
Its nice to see you noticed :-)
Title: Re: Stock inventory not changing affter purchase
Post by: coolmango on April 03, 2020, 00:08:07 AM
Hi Guys

The change I made didn't work. I've attached the screen grab to show my settings.
Are they correct?

Any product being purchased is not being removed from the inventory automatically at any stage of the process. So my client's shoppers are buying stock that isn't there. It's a problem...

any help would be great, thanks.

cheers
kim
Title: Re: Stock inventory not changing affter purchase
Post by: pinochico on April 03, 2020, 01:18:56 AM
What do you think you miss in your question?

Do you know what status you are using for product being purchased?

It would be great if you wrote this information straight into the question.
Title: Re: Stock inventory not changing affter purchase
Post by: Jörgen on April 03, 2020, 07:06:24 AM
What pinochico means is this:

What is the status of the order when payment is done ?
What is the status when the order is shipped ?
What is the status of the order when it is fully processed ?
Please show the status for an order that does not work.

Do You have the correct settingfs for stock handling ?
Do You allow customers to buy out of stock products ?
There are settings for this under VM configuration/configuration/shopfront.

Jörgen @ Kreativ Fotografi
Title: Re: Stock inventory not changing affter purchase
Post by: AH on April 03, 2020, 10:05:29 AM
Your settings look fine

Run an end to end test on a local test site with the settings you have.  This change will not work retrospectively.

You also need VM to handle products differently based on stock at hand

I think that you have not configured VM to do something differently when there is no available stock

Check the "Stock Handling" option in Configuration -> Shopfront tab

1. Products Out of Stock are orderable, no special action
2. Do not Display Product
3. Do not Display Product, if child products also out of stock
4. Displays 'Notify Me' instead of 'Add To Cart' button
5. Products Out of Stock are orderable, and the field 'Availability' below is displayed

I suggest option 4 if the product will be sold again when stock is in




Title: Re: Stock inventory not changing affter purchase
Post by: Jörgen on April 03, 2020, 10:14:29 AM
Thanks AH for clarifying what I wrote.

Jörgen @ Kreativ Fotografi
Title: Re: Stock inventory not changing affter purchase
Post by: AH on April 03, 2020, 10:56:57 AM
I thought I would - as he had already posted the settings and they looked good

A diagram helps with Shopfront / config settings :-)
Title: Re: Stock inventory not changing affter purchase
Post by: coolmango on April 08, 2020, 03:21:07 AM
Hi AH

I've attached a screen shot of the config which was already set as you suggested. It didn't need changing.

I ran a test product ($1) through the shopping cart with settings as they are. The test product was set at In Stock: 10 - Booked,Ordered: 0
It currenlty uses Paypal.
Once Paypal had finished the sale the product status changed from Booked,Ordered: 0 to Booked,Ordered: 1
In Stock remains at: 10
Obviuosly this should be 9.

What do you suggest apart from changing the stock manually.

Thanks for your help

cheers
kim
Title: Re: Stock inventory not changing affter purchase
Post by: Jörgen on April 08, 2020, 08:16:28 AM
No, No, No

You have to understand the terms in stock, and booked.

This is what has happened:
The customer has BOOKED 1 item, Your stock has not changed, there are still 10 items in stock. But orderable nr of items is 9 (instock - booked).

This is what is going to happen:
You will take the product out of stock, this will make the physical stock 9.
For a short moment physical stock will now not equal to the in stock number.
As soon as you mark the order as shipped, in stock will go from 10 to 9 and booked will go from 1 to 0.
Physical stock should always equal the in stock number of products.

So where do You think the problem is?

Do You have a correct workflow ? Or Do You do someting else, because a correct workflow will always show the correct stock.

Jörgen @ Kreativ Fotografi
Title: Re: Stock inventory not changing affter purchase
Post by: AH on April 08, 2020, 11:50:59 AM
In the VM configuration

TURN OFF stock handling at a product level!!  That is not required and will slow your site!

This maybe an easier way to view what VM should be doing

On this order flow - the booked ordered figure is the value that is removed

StatusImpactIn-Stock Ordered/bookedAvailable stock
Starting None10 010
Confirmed order      Is reserved       10 110
ShippedIs removed9 09

You can also go straight to removed - it is up to you
StatusImpactIn-Stock Ordered/bookedAvailable stock
Starting None10 010
Confirmed order      Is removed       9 09
ShippedIs removed9 09



To make things easier to understand - you could create an override to the product_status admin screen to detail the stock availability as a single figure.
Depending on your config you should not be able to order items that have 0 "available"

Available_stock = product_in_stock - product_ordered;


Title: Re: Stock inventory not changing affter purchase
Post by: coolmango on April 21, 2020, 11:40:11 AM
Hi GUys

Sorry for the slow reply...

Thanks for all that.

So I gather you are saying that the last step of the stock inventory is a manual process. Once you've selected shipped on the Orders page, then the stock is reduced by the amount from 10 to 9.

Ok so, if the stock of that product is only 1 and a shopper, has paid for it (Confirmed Order), another shopper cannot buy that product.

Thanks for all your help

cheers
kim
Title: Re: Stock inventory not changing affter purchase
Post by: GJC Web Design on April 21, 2020, 11:48:23 AM
QuoteSo I gather you are saying that the last step of the stock inventory is a manual process. Once you've selected shipped on the Orders page, then the stock is reduced by the amount from 10 to 9.

correct

QuoteOk so, if the stock of that product is only 1 and a shopper, has paid for it (Confirmed Order), another shopper cannot buy that product.

they also can't buy it is it is "Is reserved"
Title: Re: Stock inventory not changing affter purchase
Post by: Jörgen on April 21, 2020, 11:51:41 AM
The manual part depends on your workflow. If you have a system that guarantees that the stock is picked and shipped at once, you can set your order to shipped at the same time that your customer pays the order. But will eventually screw up Your inventory.

This is a normal workflow, exceptions are of course allowed, it is up to You to make sure stock is manageable.
1. Customer pays order, products are booked. (Physical stock == electronic stock)
2. Order is picked and packed. Product taken out of physical stock. (Physical stock not equal electronic stock)
3. Order is being shipped.
4. Order is electronically marked as shipped, product removed from stock. (Physical stock == electronic stock)

Jörgen @ Kreativ Fotografi

Title: Re: Stock inventory not changing affter purchase
Post by: coolmango on April 22, 2020, 04:12:23 AM
Thanks Guys

My client is a sole operator and he was hoping to have this happen automatically during the purchase procedure.
Is it possible to override the last step of 'marked as shipped' so as soon as the shopper has payed for it, it is removed from the electronic stock?
If not, then that's the way it is.  :)

Sorry to go on about it.

thanks again

cheers
kim
Title: Re: Stock inventory not changing affter purchase
Post by: Jörgen on April 22, 2020, 07:07:32 AM
Quote
The manual part depends on your workflow. If you have a system that guarantees that the stock is picked and shipped at once, you can set your order to shipped at the same time that your customer pays the order. But could eventually screw up Your inventory.
Jörgen
Title: Re: Stock inventory not changing affter purchase
Post by: AH on April 22, 2020, 09:51:36 AM
QuoteIs it possible to override the last step of 'marked as shipped' so as soon as the shopper has payed for it, it is removed from the electronic stock?


As I already noted - yes you can just set any status for confirmed payment to "Is removed" -  same for any shipped - stock only gets removed once!

Quote
You can also go straight to removed - it is up to you
StatusImpactIn-Stock Ordered/bookedAvailable stock
Starting None10 010
Confirmed order      Is removed       9 09
ShippedIs removed9 09

Title: Re: Stock inventory not changing affter purchase
Post by: Jörgen on April 22, 2020, 11:37:41 AM
@AH

What you are suggesting will still need a manual step. Setting it to shipped directly after payment skips that step. Can not really see why this would be better than setting it to reserved. The steps are there anyway.

I prefer to include the last step as it follows my workflow, taking order, confirming payment, packing, shipping.

Just my two cent

Jörgen @ Kreativ Fotografi
Title: Re: Stock inventory not changing affter purchase
Post by: AH on April 22, 2020, 14:15:15 PM
No - for me confirmed means - Confirmed Payment

Order statuses are P pending for none payment step.

So whatever the user sets for confirmed payment(s) - becomes - "Is Removed"
Title: Re: Stock inventory not changing affter purchase
Post by: Jörgen on April 22, 2020, 14:40:49 PM
We can Renate this all Day Long. But personally I would be able to see in order status what has been fine. Skipping a step is not for me. But everyone is free to try their own way.
Jörgen
Title: Re: Stock inventory not changing affter purchase
Post by: pinochico on April 22, 2020, 14:51:25 PM
QuoteSo whatever the user sets for confirmed payment(s) - becomes - "Is Removed"

You are wrong :)

We use payment, where client can restore payment by credit cards and cancel after 24 hour.

Then right is as Jorgen - remove from staff will be after shipped, untill is reserved still.
Title: Re: Stock inventory not changing affter purchase
Post by: AH on April 22, 2020, 16:35:33 PM
Pinocchio - thank you for your insight. and FYI the ability to cancel a payment up to 24 hours after it is made, is not a worldwide practice. 

If the business wants to operate in the way they have expressed, then they can do such a thing - wrong is subjective.

I dont prefer removing items from the 'product_in_stock' value before shipping. "is reserved" effectively stops such items being sold to new customers. However, it looks like the business, for which the question was raised, does not operate in that way or they do not understand what the "is reserved" status does.

That might be because the figure they want to use in the system is the stock figure and not a calculation of what is available:

Available_stock = product_in_stock - product_ordered

The specifics are for a business to work out, based on their business processes, this should not be a debate on what one person thinks is correct or another.

For me a confirmed payment is fine as "is reserved" OR "is confirmed"  Either way the item cannot be sold to another customer as it is not available!

Like many businesses, orders can be cancelled and items returned upto x days even when payment has been processed.  If/when a customer cancels an order then the status "is available" should be set. The stock is affected based on what has been set to this status.

Exactly the same as when an order is refunded/returned or items within an order are set to a returned/refunded status.

Lets hope others read this and chip in ;-)