VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: thefbi on March 05, 2022, 07:43:28 AM

Title: Products with size and stock
Post by: thefbi on March 05, 2022, 07:43:28 AM
Hi,
I have t-shirts with different sizes.
Some sizes are not in stock.
I can't find a way to manage the stock with the size variants.

I currently have my product and children's products, exemepl :
Women's T-shirt = parent
T-shirt woman 1 = child 1
T-shirt woman 2 = child 2
Etc.

These t-shirts all have sizes S / M / L / XL, which I made with a custom field type "Chain".

Thanks for help.

Joomla 3.6.10
VM 3.8.8 10472



Title: Re: Products with size and stock
Post by: Studio 42 on March 05, 2022, 09:32:42 AM
you ahve tu use multivariant or use generic variant and unpublish parent and set category in child 1, child 2
TO handel stock, you need 1 child per variant S / M / L / XL...
Title: Re: Products with size and stock
Post by: balai on March 05, 2022, 13:49:58 PM
Or the Stockable Custom Fields
https://breakdesigns.net/extensions/joomla/stockable-custom-fields
Title: Re: Products with size and stock
Post by: Studio 42 on March 05, 2022, 13:55:35 PM
Stockable Custom Fields use child too.
So if you have not plenty of child/variants you can use Virtuemart core directly
Title: Re: Products with size and stock
Post by: thefbi on March 05, 2022, 16:16:33 PM
OK, thank you,
i will try that and come back post the results.
Title: Re: Products with size and stock
Post by: thefbi on March 06, 2022, 17:01:23 PM
I managed to solve my problem with the Virtuemart Multi variant.
I tried to understand how it all works with the Virtuemart doc (https://docs.virtuemart.net/tutorials/product-creation/221-multivariant.html), but frankly, it's very difficult to understand how it works just with the doc, which is barely one page long.
It's a pity that there are no more explanations and examples.

So I will explain here how to do what I did.

Goal : Create selection fields, with stock management, for T-shirts, of different colors, sizes and for men or women.

Steps to follow:
1. Create a parent product, example Fairy T-Shirt
2. Then create each variant as a child product, example: Fairy T-Shirt - Blue - Female - S / Fairy T-Shirt - Blue - Female - M / Fairy T-Shirt - Blue - Female - L / Fairy T-Shirt - Blue - Female - XL. Do the same for each variant of this T-shirt (color, size and gender).
3. Create a custom field Multiple Variant. Cart attribute => Yes / Cart option => Yes / Template position => According to your template / Save.
4. Go to the parent product, custom fields tab.
5. Choose the multiple variant field.
6. Delete the texts that are automatically displayed in the field next to the "Name" type.
Change the type in the drop down menu to "Use a custom label".
Rename the field to "Gender" and indicate in the text field, one per line, Female / Male.
7. Click on "new" (the small + sign) to add a tree structure.
8. Select "Use a custom label", name it "Color" and type the colors in the text field (one per line).
9. Repeat the operation for the sizes.
10. Save.
11. Select in front of each child product in the list the corresponding selection criteria, EXCEPT for the parent.
12. Save and close.
13. For each child, set the stock.
14. That's it!

You see, that is a documentation example, not too complicated to write.
Title: Re: Products with size and stock
Post by: thefbi on March 06, 2022, 17:04:17 PM
Here is some screenshot of the product custom field
Title: Re: Products with size and stock
Post by: GJC Web Design on March 06, 2022, 21:57:26 PM
good video from Petra here ->  https://www.youtube.com/watch?v=dtdj_ei8iCY