VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: xniickiidx on September 15, 2015, 11:43:02 AM

Title: Pending Items affecting Stock
Post by: xniickiidx on September 15, 2015, 11:43:02 AM
I am using Joomla! 2.5.28 with VirtueMart 2.6.18 on my Shop website as this was the only stable version I found to fix email and order issues I was having with newer versions.

http://www.alanabellclothing.uk/

But there is a problem I cannot find a solution for - Pending Items which customers have added to their carts or pending orders made by customers seems to remove those items from the stock and I don't want items to removed from the stock of the shop until their order has been confirmed. How do I set it up so that it works like this?


If anyone can help me that would be much appreciated - thank you in advance for any help.
Title: Re: Pending Items affecting Stock
Post by: GJC Web Design on September 15, 2015, 12:03:31 PM
afaik this is the core behaviour

a quick search in e.g. products.php shows things like

$where[] = ' p.`product_in_stock` - p.`product_ordered` >"0" ';

product_ordered I assume is pending ordered goods

in orders.php there is the function
function handleStockAfterStatusChangedPerProduct() that handles this behaviour

prob changes needed there
Title: Re: Pending Items affecting Stock
Post by: xniickiidx on September 15, 2015, 12:08:42 PM
Thank you for your help GJC..

I am not familiar with editing php coding - would you be able to point me in the right direction to get advice on what I need to alter the code to for it to work how I want? Or are there any sites you could recommend which would help me fix this?


Best regards.
Title: Re: Pending Items affecting Stock
Post by: GJC Web Design on September 15, 2015, 12:13:16 PM
hmmm .. your asking to learn php so you can change some code?

If you don't have the skills and you want some coding done then you employ someone to do it.. sorry,  that's life....

I haven't looked at the function details but assume that is where the changes are needed

Title: Re: Pending Items affecting Stock
Post by: AH on September 15, 2015, 12:20:23 PM
You do not need to use coding to change the behaviour of how stock is handled it is part of core configuration  :)

Just change the configuration relating to the "order statuses" and how they handle the stock.

admin/configuration/order statuses

You will see the stock handling setting for each status

Change the status from "is reserved" to "is available"


Title: Re: Pending Items affecting Stock
Post by: GJC Web Design on September 15, 2015, 12:29:24 PM
Now I never knew that.. you haven't been reading the docs again have you Hutson?

Is this on 2.6.18 as well?
Title: Re: Pending Items affecting Stock
Post by: AH on September 15, 2015, 12:59:07 PM
I am pretty certain it is in VM2 and VM3  :)
Title: Re: Pending Items affecting Stock
Post by: xniickiidx on September 15, 2015, 13:17:33 PM
Thank you so much for this resolution I have been stuck with the issue for a while and changing that simple setting has fixed it for me :)

Very much appreciated
Title: Re: Pending Items affecting Stock
Post by: AH on September 15, 2015, 13:36:41 PM
You are welcome  :)