VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: toonetcreation on June 13, 2012, 10:45:12 AM

Title: Stock management problem (main product with childs products)
Post by: toonetcreation on June 13, 2012, 10:45:12 AM
Hello,

I don't know if this is an issue or not, but when I add a product (with a stock level = 15 for example) + 3 childs products (1 for size S, 1 for size M, 1 for size L) with a specific stock level for each size, the main stock (level=15) does not decrease when a user place an order. Only the stock for each size decrease.

Someone has an idea to solve this problem?

Thanks in advance
Laurent
Title: Re: Stock management problem (main product with childs products)
Post by: Willc on June 13, 2012, 13:47:50 PM
This file may will sove the problem.
Extract and replace:
administrator/components/com_virtuemart/models/product.php


Dont forget to backup your unmodified files before overwrite.



[attachment cleanup by admin]
Title: Re: Stock management problem (main product with childs products)
Post by: toonetcreation on June 13, 2012, 15:15:26 PM
Thank you for your help.
I have tried to replace this file and I have made a test with a new order.

Context:

- I have added 1 main product + 2 childs products

- child product A in stock = 8 + child product B in stock = 5, so main product total in stock = 13

Results:

- the main product stock level decrease correctly when a new order is placed -> OK

- I try to edit the main product (through the BACK END) in components -> VirtueMart -> Products -> "My main product" and when I save the changes (with save button or save & close button), the stock level in Product Status tab is systematically multiplied by itself-> why ?

- If I go to Custom fields tab (on the main product), I can see the current stock level for childs products (see attached file called stock_custom_fields.png). But If I go to the child product information page, in Product status tab, the stock level is not displayed and I can't change it (see attached file called stock_child_product.png). If I try to add a new number and if I save, a message is displayed that changes are successfully saved but the number into the In stock field disappears. I have to go to the main product information page then Custom fields tab to see the child product stock increasing -> why ?

[attachment cleanup by admin]
Title: Re: Stock management problem (main product with childs products)
Post by: uschmi on June 13, 2012, 15:18:44 PM
Just the same problem for me: when adding a stock number and saving, the stock disappears...
Joomla 2.5.4 + VM 2.0.6 + modification above
Title: Re: Stock management problem (main product with childs products)
Post by: toonetcreation on June 13, 2012, 15:42:12 PM
Other details, I'm using Joomla 2.5.4 + VM 2.0.6
Title: Re: Stock management problem (main product with childs products)
Post by: toonetcreation on August 08, 2012, 09:42:02 AM
Infos here:

http://forum.virtuemart.net/index.php?topic=104852.0