VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: aravot on September 23, 2011, 22:06:55 PM

Title: Product Types in VirtueMart 2.0 How?
Post by: aravot on September 23, 2011, 22:06:55 PM
In VirtueMart 1.1 we had 'Product Types' which we could use to extend/add product information, this feature has been replaced in VirtueMart 2.0 I think by 'Custom Fields' if so could someone please explain how it works because I can't figure it out.

Example of Product type in VM 1.1
Create a Product Type 'Technological Specs'

(http://www.protechsystems.us/stuff/joomla/vm/vm11-product-type-list.png)

Add 'Product Parameters' to 'Technological Specs'

(http://www.protechsystems.us/stuff/joomla/vm/vm11-parameters-of-product-type.png)

Assign 'Technological Specs' to products, final result.

(http://www.protechsystems.us/stuff/joomla/vm/vm11-product-type.png)

How to create the same effect in VM 2.0?
I go to custom fields create 'Technological Specs' now how to add parameters or more custom fields to this.

Tried to create individual custom fields (parameters) example 'Camera Effective Pixels', 'Optical Zoom', 'Exposure' and etc but how to combine these into one parent custom field (Product Type (Technological Specs)) and finally how to assign values to these custom fields?
Example created custom fields 'Camera Effective Pixels' how to give value to this filed '6 Megapixels, 8 Megapixels, 10 Megapixels' and etc so I could assign it to product.

This is how it looks in VM 1.1 but in VM 2.0 I don't see a field for value.
(http://www.protechsystems.us/stuff/joomla/vm/vm11-parameter-information.png)
Title: Re: Product Types in VirtueMart 2.0 How?
Post by: Studio 42 on September 23, 2011, 23:13:41 PM
You can do the same , but for now we don't finished all the extention for it.

for your eg.
Prepare group of custom fields, before using it :
Create a Product Type 'Technological Specs'
=
go to customfields menu then
create NEW customfields

title : 'Technological Specs'
select
type:parent
SAVE

------------------------------------------

create NEW customfields
'Camera Effective Pixels'
Description:Megapixels
Default:8
tooltips:Size of Sensor

Parent : 'Technological Specs'
select
type:string
published : yes
(the other to 'no')

SAVE

------------------------------------------

create NEW customfields
title :'Optical Zoom'
Description:X
Default:5
tooltips:20X Optical Zoom is great ...

Parent : 'Technological Specs'
select
type:string
published : yes
(the other to 'no')

SAVE

------------------------------------------

create NEW customfields
title :'Exposure'
Description:X
Default:5
tooltips:Exposure the ammount of light ...

Parent : 'Technological Specs'
select
type:string
published : yes
(the other to 'no')

SAVE

.....

Add all the value in on click

go in your product : tab >> Custom Fields

Click on the select list  'Technological Specs'
all param are in product
change the value
SAVE

For info : you can "clone" customfields on selecting it on the list, YOu don't have to rewrite all as in VM1.1
YOu can delete fields and add new one
you can change the CSS in FE to render it inline or as paragraph
product-field product-field-type-P for eg. is the class for "parent" customfield
YOu can add images and more to come

If you wan't more customisable customfields(audio,video,javascript,color picker...), the custom plugins are on the way...

Title: Re: Product Types in VirtueMart 2.0 How?
Post by: Vincentatweb on September 25, 2011, 16:25:28 PM
Excellent question from aravot and respons from Electrocity :)
Title: Re: Product Types in VirtueMart 2.0 How?
Post by: aravot on September 26, 2011, 00:33:51 AM
Thank you.

Few observations; when a parent custom filed is added to a product and later a custom filed is added to that parent custom filed the newly added custom filed is not shown in product custom filed tab, the parent custom filed has to be re-added which result to duplicate fields, hope it is clear if not I can post a video.

To give a better example:
Create a parent custom field 'Technological Specs'
add two custom fields 'Optical Zoom' and 'Camera Effective Pixels' to 'Technological Specs'
add the 'Technological Specs' to a product
next add another custom fields 'Exposure' to 'Technological Specs', this new custom field is not shown in product, will have to re-add 'Technological Specs' which result to duplicate entries.

-------
In my option it would be better to have an option to enter values to custom fields when there are created as it was in VM 1.1, this way when a custom field is add to a product it is easier to pick a value from the list of previously entered values rather than add values, why because when values have to be added to 100s of products it becomes tedious task, and when mistake is made only one value needs to be change not go through each product and modify the value.

VM 1.1 layout.
(http://www.protechsystems.us/stuff/joomla/vm/vm11-parametervalue.png)
Title: Re: Product Types in VirtueMart 2.0 How?
Post by: Vincentatweb on September 26, 2011, 14:37:05 PM
I reproduced this and encountered the same problem (with the duplicate fields).
Title: Re: Product Types in VirtueMart 2.0 How?
Post by: aravot on October 07, 2011, 20:01:23 PM
I tried v1.9.8.H, I see same problem must enter value for every product instead of entering it once and selecting it from a list and no multiple select option like in VM 1.1
Title: Re: Product Types in VirtueMart 2.0 How?
Post by: Milbo on October 10, 2011, 18:22:37 PM
Maybe this tutorial helps http://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_product_customfields

not finished, but a start
Title: Re: Product Types in VirtueMart 2.0 How?
Post by: aravot on October 10, 2011, 21:54:25 PM
It doesn't have multiple select option, so only values that are need can be selected, (please see VM 1.1).

Example; I have following values and only need to select 4 for a specific camera and 5 for another camera and etc, without multiple select option this task is difficult.

4416 x 3312; 4416 x 2480; 4000 x 3000; 4000 x 2248; 3648 x 2736; 3648 x 2048; 3456 x 2592; 3264 x 2448; 3072 x 2304; 2816 x 2112; 2592 x 1944; 2560 x 1920; 2272 x 1704; 2048 x 1536; 1600 x 1200; 640 x 480
Title: Re: Product Types in VirtueMart 2.0 How?
Post by: domin8tor24 on October 13, 2011, 12:13:41 PM
This is a great topic and had a great response. Id love to know more about what each custom field does - i.e. how to use the string, integer etc. functions, as I'm not quite sure of this.

Cheers!
Title: Re: Product Types in VirtueMart 2.0 How?
Post by: advergroup on April 11, 2012, 05:00:46 AM
Let me start this post by saying: I hope someone tells me that I am wrong.

From what I am reading, these custom fields appear to be a step back words from Product Types.  :'(

I was using the Cherry Picker Module that provided a great filter for Product Types. That developer did a good job of outlining the draw backs of this new Custom Field replacing the Product Types.

http://www.galt.md/index.php?option=com_blog&a=74&Itemid=82 

I am most concerned with ease of set up and most importantly performance, as the site I am managing has over 140,000 items.

This is a quote from the link above that provides insight as to why this is a step back words.

Performance
Performance may be a great issue especially for those who have large amount of products.
Let's have a comparative example between Product Type and Custom Fields (we will not delve deep into details).
Let us say, we have 2,000 products and 2 Product Types, each has 1,000 products. And each Product Type has 5 Parameters (like: Brand, Screen, Ram, Hdd, OS).
In Virtuemart 1.1 this would be represented in Database with 2 tables: "vm_product_type_1" and "vm_product_type_2" with 6 columns in each: first column is "product_id" and rest five for each parameter.

Naturally, each of two tables would have 1,000 records.
And when performing a search MySQL will look up only among 1,000 records.

Now let's see how Custom Fields would store 2,000 products' filters in Database.
All values are stored in one table "virtuemart_product_customfields". Every Parameter is being inserted as new record, so one product with our 5 parameters will have 6 records: 5 records for parameters plus 1 record for parent-custom-field (the one that stores 5 custom fields as children).
So our 2,000 products will end up as 12,000 records.

Now, from a logical point of view, in which case 50* SQL queries will perform better (look up from 1K or 12K of records)? :)
* - It's just an example for 50 filters that make 50 queries.


The most disappointing thing is that this new version of Virtuemart sounds like it will force my client t move in another direction.
:'( :'( :'( :'