VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: wbyers on July 20, 2017, 14:21:02 PM

Title: product_ordered
Post by: wbyers on July 20, 2017, 14:21:02 PM
Hello, We're having an issue with the product_ordered field filling when we don't want it to. It throws off our systems. Does anyone know why it would be triggering and when? As in what is there in the default system that makes it activiate?
Title: Re: product_ordered
Post by: Ghost on July 20, 2017, 14:28:48 PM
It increases when the product is ordered. It's part of stock management.
Title: Re: product_ordered
Post by: wbyers on July 20, 2017, 14:31:37 PM
Okay, is there anyway outside of core hacking to prevent it from firing? It's messing with customer's ability to make orders of our products. Because in our case it does not update when an order is actually made. It can sometimes be days before we have a change in product_ordered.
Title: Re: product_ordered
Post by: AH on July 20, 2017, 19:28:46 PM
Look at the order status codes in shop_>configuration

Change the stock handling setting of the statuses to the required setting

"Is available" - looks to be the setting you want
Title: Re: product_ordered
Post by: wbyers on July 20, 2017, 19:34:44 PM
How does that solve product ordered being filled, positive or negative?
Title: Re: product_ordered
Post by: AH on July 23, 2017, 11:26:56 AM
QuoteHow does that solve product ordered being filled, positive or negative?

Because product_ordered is controlled by the setting.

When an order status is changed the "Stock handling" setting for the new status effects the change of the product_ordered value.

QuoteBecause in our case it does not update when an order is actually made. It can sometimes be days before we have a change in product_ordered.

If you want the value to change then look at your order status settings in admin.

If the value does not update then it is to do with the statuses you are using for your orders.








Title: Re: product_ordered
Post by: wbyers on July 24, 2017, 14:34:51 PM
Okay, so does "is available" enable the product_ordered field to change? Cause that's whats not on the confirmation status we are using. I'm assuming yes but I want to make sure before I begin changing things.

7/24/2017 -9:25
Okay ran a cancellation which is a status that has is available and it has not changed the product_ordered for the program. What should I have done instead?
Title: Re: product_ordered
Post by: AH on July 24, 2017, 19:25:01 PM
There are 3 status options

Is available
Is reserved
Is removed

Depending on what the sequence of the order status has been will dictate what product ordered value is set to and what happens to the product_in_stock

Look at the status flow of your orders to determine what happens to the product_ordered figure.

Changing from one status to another that has the same "stock handling" setting will not change anything

Setting is available - should reduce product_ordered value by the item ordered quantity
Setting is reserved - should increase the product_ordered value by the item ordered quantity
Setting is removed - should reduce product_ordered value by the item ordered quantity

If the product_in_stock figure needs to be adjusted then it will be.

Title: Re: product_ordered
Post by: wbyers on July 24, 2017, 19:32:26 PM
So if we just want the product to be interacted with without filling or changing product_ordered, we'd want to use is removed?
Title: Re: product_ordered
Post by: AH on July 24, 2017, 19:51:06 PM
Just updated my reply

You have to consider the changes of status

Then you will be able to determine what you need to set

Title: Re: product_ordered
Post by: wbyers on July 24, 2017, 20:03:55 PM
Okay, but thing is at the moment the product ordered only rarely changes. My goal is to stop it from changing because it causes trouble for our stock system. Does any of those not fire a signal at all or do I just have the three options?
Title: Re: product_ordered
Post by: AH on July 24, 2017, 20:15:37 PM
"Does any of those not fire a signal at"

Not sure what you mean by that. Changing a status always looks at what it should do with product-ordered and product_in_stock.

And what it should do depends on the prior status.




It looks to me like you don't want to use the "is reserved" status

and therefore should only use :

Is removed

and/or

Is available

What trouble is it causing?





Title: Re: product_ordered
Post by: wbyers on July 24, 2017, 20:23:03 PM
Basically, it effects product_in_stock like it's supposed to but we don't use product_ordered in any capacity and it doesn't change regularly. It seems to change and start getting affected by order statuses at random. going from swinging both positive or negative on a given product or set of products.
Title: Re: product_ordered
Post by: AH on July 24, 2017, 20:31:04 PM
I suggest :

Use - "is available" for most statuses

and  use "Is removed" - for statuses that should remove stock from product_in_stock

Note: that this could mean more orders can be taken that stock available as "on order" will not be taken into consideration


Title: Re: product_ordered
Post by: wbyers on July 24, 2017, 20:32:37 PM
Will that keep product_ordered from acting up?
Title: Re: product_ordered
Post by: AH on July 24, 2017, 20:33:46 PM
It should do -  but I cannot guarantee it
Title: Re: product_ordered
Post by: wbyers on July 24, 2017, 20:41:49 PM
Thanks, I'll let you know if that does the trick. It should be you never know. I mean there were only two with status is reserved.
Title: Re: product_ordered
Post by: AH on July 24, 2017, 21:00:22 PM
If you set most statuses to "is removed"

That should sort it out  :)

Set anything that cancels and order to "is available" (this should positively update the stock value" and leave product_ordered alone.

Title: Re: product_ordered
Post by: wbyers on July 24, 2017, 21:14:43 PM
Fortunately there where only two that really needed changing