VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: David on January 16, 2017, 00:30:58 AM

Title: Custom fields again
Post by: David on January 16, 2017, 00:30:58 AM
Let's have a software product to be sold by Virtuemart.
Price of the license is influenced by two parameters:
- number of users (1, 3, 5, or 10)
- license period (1, 2, or 3 years)

So there is a matrix of 4x3 possible prices of the product.

There is no need to keep stock numbers.

I assume that the only way how to achieve this is via Multi Variants, i.e. one parent product and 4x3=12 child products...?  Or is there a simpler way?
Title: Re: Custom fields again
Post by: Jumbo! on January 16, 2017, 09:08:36 AM
You can use normal String type custom field to achieve this. Since you do not maintain stock for the products you do not need Multi Variants.
Title: Re: Custom fields again
Post by: David on January 16, 2017, 12:25:43 PM
I don't think I can use normal String fields.
Each combination of the previously mentioned 2 parameters makes a specific price, which cannot be achieved by simple +something price modifiers used by normal String fields.
The 2 parameters depend on each other.
Title: Re: Custom fields again
Post by: balai on January 17, 2017, 10:13:36 AM
I suppose you can try using child products.
Possibly the Stockable Custom Fields can help you
https://breakdesigns.net/extensions/stockable-custom-fields
Title: Re: Custom fields again
Post by: Studio 42 on January 17, 2017, 17:36:41 PM
I devlopped i price matrix similar to your case for a customer.
In he's case this are price steps for square meters, but with some changes, this can work with list too.
Contact me, if you don't find an existing solution.
Title: Re: Custom fields again
Post by: David on February 21, 2017, 18:44:06 PM
This tutorial was very useful:
https://www.youtube.com/watch?v=dtdj_ei8iCY

However:
I have many products which share the same variant descriptions and values. Is it necessary to enter the descriptions and their values manually by each product, or is there a way how to predefine description name and values and then use it in multivariants?

For example, lets have 50 products, all being sold in 4 sizes and 4 colors. Do I have to enter manually in each product's custom field section multivariant that first description is called "Size" and has values "S, M, L, XL" and second description is called "Color" and has values "Red, White, Green, Blue"?
Title: Re: Custom fields again
Post by: Milbo on February 24, 2017, 13:50:35 PM
https://docs.virtuemart.net/manual/general-concepts/186-derived-products-product-pattern-child-products.html
Title: Re: Custom fields again
Post by: David on February 27, 2017, 07:32:18 AM
Thanks. I dont understand that part on "fully customisable Variant", but I hope I dont need it.

Anyway: I have created an unpublished product as a pattern and then created a child.
However:
- neither category nor manufacturer were inherited
- after deleting the child product, an "orphan" row remains instead of it on the Custom Fields tab of its parent, and every attempt to save the parent product generates errors:
vmError: VmTable #__virtuemart_products_cs_cz Check not passed. Neither slug nor obligatory value at product_name for auto slug creation is given 29
vmError: You are not an administrator or the correct vendor, storing of product cancelled
Title: Re: Custom fields again
Post by: Milbo on February 27, 2017, 09:36:34 AM
"- neither category nor manufacturer were inherited"
How do you know?

"- after deleting the child product, an "orphan" row remains instead of it on the Custom Fields tab of its parent,"
fixed in the next version
Title: Re: Custom fields again
Post by: David on February 27, 2017, 16:31:12 PM
Quote from: Milbo on February 27, 2017, 09:36:34 AM
"- neither category nor manufacturer were inherited"
How do you know?
I know it because the child product does not appear in the front end under the category. It only appears there when I manually assign the category to the child product.
Title: Re: Custom fields again
Post by: Studio 42 on February 27, 2017, 16:44:16 PM
Category get never inherited.
If you use parent as model, you have to set category in each child.
This is to have possibility to display, or not, child in the category.
Title: Re: Custom fields again
Post by: David on February 27, 2017, 16:51:36 PM
Quote from: Studio 42 on February 27, 2017, 16:44:16 PM
Category get never inherited.
If you use parent as model, you have to set category in each child.
This is to have possibility to display, or not, child in the category.

Then someone should correct the Virtuemart documentation: https://docs.virtuemart.net/manual/products-menu/product.html - because it says that "The only parameter that the child product does not inherit and must be unique is the slug/ alias."