News:

Support the VirtueMart project and become a member

Main Menu

Product Types in VirtueMart 2.0 How?

Started by aravot, September 23, 2011, 22:06:55 PM

Previous topic - Next topic

aravot

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'



Add 'Product Parameters' to 'Technological Specs'



Assign 'Technological Specs' to products, final result.



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.

Studio 42

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...


Vincentatweb

Excellent question from aravot and respons from Electrocity :)

aravot

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.


Vincentatweb

I reproduced this and encountered the same problem (with the duplicate fields).

aravot

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

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

aravot

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

domin8tor24

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!

advergroup

#9
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.:'( :'( :'( :'