Login Form

How to set up custom attribute drop down fields in VirtueMart 2.X

If you’ve decided to use VirtueMart 2.X on your Joomla! site to sell any number of products, you may be running into some trouble trying to set up some custom fields for specific types of products. For example you may have a t-shirt that comes in different sizes, or a type of bracelet that has different gold or silver type options, maybe you sell sweaters that come in a number of different colors as well.

Trying to navigate VirtueMart’s custom field options can leave an individual who is unfamiliar with the platform tearing at their hair trying to get them to behave properly. VirtueMart is notoriously confusing, especially when it comes to establishing a simple drop down menu to allow a size or color option for an individual product. What I’ve outlined here are a list of steps that can take the average online store owner through the process of setting up a series of custom attributes, and then how to display those attributes as a simple drop down menu on the front end of the site. This can also be applied towards other types of attributes such as text fields.

For the purpose of this tutorial, we assume you already have VirtueMart installed with some products setup.

Lets’ begin by logging into the admin panel of your Joomla! Site.

1. Go to ComponentsVirtueMart

2. Click the “Custom Fields” tab on the menu at the far left side of the page under the Products section.

3. Click the “New” button at the top right of the page with a green plus icon above it, right next to the cancel button.

4. For “custom field type” select “cart variant.”

5. Type the name of the attribute in “title,” for example I will make a drop down list for “Size.”

6. Click “Yes” for the “cart attribute” radio button

7. In the field “Default” type in the attributes separated by a semi-colon. In this case I will type “small; medium; large”

8. Then go to the question “Is this a list?” and select “Yes.”

9. Then click “Save” in the top right to save the custom attribute.

10. Now go to the “Products.” tab on the menu at the far left side of the page under the Products section.

11. Select the individual product you would like to add this attribute to.

12. Click the “Custom Fields” tab of that individual product at the top right of the page.

13. Now go to “Custom Field Type” drop down, and select “size,” or whatever custom field you desire to be displayed on that page.


You must add that same custom field for each instance of that attribute. It is intuitive to think that by adding the size custom field to a product that you would then see a drop down list of sizes on the store. THIS IS NOT THE CASE.

14. So you have just added the size custom field and you will see a drop down list that shows small, medium, and large as specified.

Select “small” and then in the open box to the right you can add an additional cost if there is a price change associated with that size. If there is no price change leave that field empty.

Now you must select “size” once again from the “custom field type” drop down. Again you will see size appear below size. Now select “medium” from the drop down. If there is a price increase you can specify it here as well.

Once again select “size” from “custom field type” and this time specify “large” from your drop down. You can then add any price increase information in the empty field to the right if necessary.

This will create a single drop down on the front end with the options “small, medium, and large.”

15. Click “save” and go to the product on the front-end, you should now see a drop down with your new custom attributes.


If a specific product only has the options of “small, medium” then just leave off “large” when you are adding each attribute to the product.

The key here is that each custom field created can have all of the options, or just a few of them, but that needs to be specified by you for each product, even when a product will use all attributes for a specified custom field.


To achieve this, at step 2, we can create all of the different custom fields that we would like for our products. Just create the field for size with the values desired entered into the “default” field separated by a semi-colon.

Then save that custom field and add a new field called “color” with the “default” field having the color values desired inside of it separated by a semi-colon. e.g. “green; blue; pink.” 

When we go to the product page we will then add one “custom field type” for each attribute required. e.g. “small, medium, large, green, blue, pink.”

Because these are now two different attribute types they will automatically show as “size” and “color” on the front end with drop downs showing the values specified for that product in the product custom attributes list.

Congratulations! You’ve successfully just set up custom attributes for use on any of the products in your store. This same process can be use to apply any number of options to your products as well as apply new prices for those options if necessary.

Mike Rispoli
Sysgen Media LLC


Virtuemart 2.0 Multi Dimensional Product Display- How to display Product Colours & Sizes with stock control? 17-05-2013, 07:32

Virtuemart 2.0 Multi Dimensional Product Display- How to display Product Colours & Sizes with stock control?

We are using Virtuemart for last 4 years now and we love it. Very recently we upgraded to VM2.0 and astonished to find a limitation of displaying multidimensional products e.g Tshirt with various colour and sizes.

There is little solution to this problem for example Breezing forms commercial version is available which you can program to display various dimension. But to this solution you have to sacrifice stock control. For this reason it was out of my selection list.

After several hours of searching I found Easy Inventory Control –another commercial component-perform Virtuemart Overrite turn out to be a complete disappointment!

I am sure if you are reading this article then probably you are going through similar experience and want to know how you can display product on Virtue mart with various colours, sizes, prices with stock control.

For this Multidimensional product display with stock control –I used Virtuemart 2.0 in built custom fields and created a simple plugins and used Virtuemart –Product Parent- Child features.

For your understanding I added the step by step process as tutorials and later will upload videos for easier understanding.

Phase 1: Creating Custom Field Plug-in


Go to Custom Fields on Virtuemart on Product Section and select Custom fields. Then click New –then a new custom field window will appear:

Please select Custom field type as Plugins, Select Yes to Cart Attribute, and Select Plugins as Stockable Variants.

Once you selected Stockable variants then a list of further option will appear where you have to define options such as Colours and its values.

From the image screenshot you can see I put first Option name as Colours and values as Black, White, Red, Green, Yellow and similarly Option Values small, Medium and Large for option name Size.

Once done Click Save and you are done with your plugins.

Note: I will create a video demonstration later for easier understanding.

Phase 2: Creating Parent –child products

Ok here is the scenario for the product display. I have Tshirt with 2 colours Yellow and Green. On Yellow –I have small(5), Medium (4) and on Green I have XL (3) and XXL(4).(Numbers are item in stock).

So I will create My Parent Item Tshirt first then I will create in total of 4 child items. .

Image: Created 4 Child Products under TShirt (Parent)

Once Child Product created –then please click save and save them.
Then click to the clid product list on Product Page and make below changes:
Add SKU, Check Currency next to cost price.
Do no select Shopper Group or Product Categories
Go to Product Status Tab and Enter Stock.
Save and Exist
Repeat these steps for each child products.

Also you will be able to verify listing on Parent Product as below:

Now on the final steps you have to adjust the listing on Custom Field Tab on Parent Item :.

On the image when I selected Custom field type as my created plugins Colours and Sizes –its displaying 4 entry for 4 child items to set their property information.

Now we have to select appropriate information and we have to click [TickBox] Parent Variant to make the item associated with the Parent Item.

Once Done Click Save and Close.

Additional Steps:

Added Images on Parent Item, Added Stocks on Parent items.

Now lets see how its appearing on Front end:

Note: You also can define different prices on each product types.

I will try to upload a video tutorials so please check back for more understanding.

JMB Designs, LLC 03-06-2013, 00:15

Just used the instructions posted by admin and they worked PERFECTLY. Best tutorial I found! VM 2.0.20b

Mayur 11-07-2013, 07:43

I want to add Textarea as custom field. But not able to use that on front end. I follow the same above procedure with option text area but not able to display it.
Please help me in this.

admin 11-07-2013, 09:46

Currently this method only supports drop downs. You’ll need to do something else to use Text Areas.

Mayur 12-07-2013, 01:15

Thanks for your immediate support.This tutorial works very fine with drop down option.

If possible then can you please guide me by which steps I can get output as “Textarea” for product custom fields.


Sven 12-07-2013, 06:38

Hi, the first solution above partly works, but I’m still waiting for the video or pictures
Pleas upload them to somewhere and post the URL here! 🙂

Nick 14-08-2013, 21:43

Hi, i have just followed these directions clearly and they are fantastic. I do have one question however. I am setting up a product that has a stock count of 251. It is a football and i am hoping that buyers can choose what number ball they want from 1-251. I can easily create the dropdown menu that will list the balls from 1-251 but how do i make it known that when someone buys ball number 5 of 251 then that ball is no longer in stock? Any help would be great. Thanks again.

admin 15-08-2013, 08:59

Hi Nick,

You would not be able to use this technique for that purpose. Instead look into using Child products.


Sorry we dont have images of the process at this time…

Paul Scollon 22-08-2013, 06:16

Thanks for this article, it really helped me get to grip with custom fields in VM2. However, I was very frustrated still about bulk application of the fields to multiple products, so I finally wrote this article when I figured it out: http://www.altfire.ie/last-night-a-joomla-extension-saved-my-life/

It does mention an adjustment to the method outlined in your post to make it work. Hope someone finds it useful.

Heather King 07-10-2013, 06:17

Hi this has been a great tutorial and has worked perfectly apart from on Internet Explorer where the menu dowsn’t drop down at all. Do you have any ideas why that might be. Any help would be greatly appreciated.

Maxis 24-10-2013, 08:28

Thanks for posting! (Pictures would have been nice addition)

yorai 06-11-2013, 17:25

i have been strugelling with this for hours… wish i knew your guide excisted. thanks!

ollie from C. 09-11-2013, 04:44

Hi, thanks a lot for this great tutorial! It helps very much! But I still have a big problem: I’m working on a bilingual shop (German / English) and that does not work at all. The drop down menus are only shown either on the “German site” or on the “English site” depending on the langues I create the variants in. Any help would be greatly appreciated!

bombki dekorowane 26-11-2013, 00:49

I seldom leave comments, but i did some searching and wound up
here How to set up custom attribute drop down fields in VirtueMart 2.X
| Sysgen Media Blog. And I do have 2 questions for
you if you do not mind. Could it be only me or does it give the impression like some of these responses appear
as if they are left by brain dead folks? 😛 And, if you are posting at additional social sites, I would like to keep
up with everything new you have to post. Could you make
a list of the complete urls of all your public
sites like your twitter feed, Facebook page or linkedin profile?

admin 26-11-2013, 13:39

I believe you will need to make separate variants for each language…

admin 26-11-2013, 13:40

Thanks! Glad we could help!

We have a Facebook Page: http://www.facebook.com/SysgenMedia

And we have a Twitter Account: http://twitter.com/SysgenMedia

ikiK 03-12-2013, 15:05

Thank you!

admin 28-12-2013, 13:26

Hi Heather,

My assumption is there there is a Javascript conflict or error going on within your site. Make sure all components and plugins are up to date, and try using Firebug (a firefox add-on) to debug any JS issues.

admin 28-12-2013, 13:32

Hi Ollie,

I believe you need to set up attributes on a per language basis. This allows you to create language specific attribute values, such as “Large” vs. “Grande”.

UK 15-01-2014, 04:50

Absolutely amazing. It really helped me setting up size & colors for products.
I also liked the plug-in solution provided in first comment.

It works great.

Is there any way i can associate actual colors instead of names?

admin 15-01-2014, 10:35

There may be a plugin for this, however you could use actual colors if you make some modifications to your templates. Perhaps naming some color swatche images the same name as your fields and using some crafty coding you could call an image instead of printing out the label.

Pilar 20-01-2014, 04:48

Good way of describing, and pleasant post to get facts concerning my presentation subject, which i am going to present in institution of higher

Francesco Abeni 17-03-2014, 05:06

Very good tutorial, thank you.

Sebastian 19-03-2014, 14:21

Great tutorial! Thank you.
Is there a way to put the picture of the child product when you select one of the drop down menu choices?
Thanks for your help


Fab 11-04-2014, 10:34

Hi, very good tutorial indeed, however, something not expected came in the picture : I’m using a simple “Photo custom field” to illustrate the color option of my articles – instead of a drop down, I get a list of small icons. The administrator system seem to fetch all the pictures from the stories/virtuemart/product folder where all my illustrations for my articles are. It was fine in the beginning but as the number of illustrations for my articles is growing, it gets very confusing and the drop down list I get on my administration tool (when I’m adding a photo custom field) is getting huge.
Would someone know how to force the administration to look into a single folder for photo custom fields?

Mychele 20-08-2014, 18:24

Hi, very good tutorial for drop down, my client is selling mattress among other furniture, mattress’s come in 4 sizes at the store they are advertising as a set (box spring & Mattress) but lots of peeps don’t want the box spring or some do, so I made the drop down for sizes, but how do I had box spring all are $100. extra except for king size they are $200. I offered my services for adding their stock to the shopping cart, very large site, my first time could somebody help me please.


ratchanok 17-09-2014, 22:41

thaink you so much.

Borys Karpinskyy 22-11-2014, 21:22

I have created the stackable custom fields properly. Now i have the problem, that it just won’t keep the order, i put them in.

i have 2 colors and 5 sizes

1. Color

2. Size

Now when its displayed in fronted, it makes some trouble:

1. It displays the sizes in following order:


how to keep it ascending in size?

2. The option of adding quantity does not show the + & – button anymore… can’t find any error in code…

3. Somehow it shows also items that are out of stock.

Are there any solutions for the first point at least?

Thanks for the description. Was really easy to do the fields with it.


M PITTS 08-01-2015, 13:35

Hello, Hope you are still around. I tried you tutorial however, instead of having one attribute I have the several I put in. i.e. small, medium and large with each individual cost attribute as opposed to one “drop down with (my) custom attributes”.. What am I doing wrong?. Thank you very much.

sheyda 13-01-2015, 07:22

Hi. I did every thing you mentioned step by step. but nothing changed in the product page at the front-end of my site. might that be happening because of not having a particular plugin installed??!!

Rod 02-02-2015, 22:40

I’m developing a new website, with Virtuemart as our shop. I’ve spent days trying to get what used to be an attribute (in Virtuemart 1) working, and this is the first sensible description I found. The info on the virtuemart forum was useless, I’m afraid. Many, many thanks!

chrisk sk 02-03-2015, 03:36

i have tried everything but the custom fields are not showign in the front

i have PHP 5.4 vMart 3.0.2 joomla3.3.6

i have put 3 diffrent custom fields in a product (string, list) but when i am doing a wuery in product details/ default.php

customfieldsSorted)) {
echo “djasjkdja”;
echo $this->loadTemplate(‘customfields’);
else {echo “no custom fields”;


if (!empty($this->product->customfieldsSorted[‘onbot’])) {
echo “djasjkdja”;
echo $this->loadTemplate(‘customfields’);
else {echo “no custom fields”;

// Product Custom ontop end

and i get no custoom fields as result for the both
I have checked all the options published and active fro custom fields and dont know what else to do

Lilia 07-03-2015, 11:40


is there a guide like that for Joomla 3 and VM 3? I’ve been searching the net for days and this is the best manual i’ve seen so far, but it doesn’t really work on VM 3…


admin 12-03-2015, 13:36

Sorry, at this time we only have the guide for VM 2. We have not used VirtueMart 3 on any projects yet. 🙂

admin 12-03-2015, 13:37

This guide is for VM 2, it does not apply to VM 3.

admin 12-03-2015, 13:37

Unsure, but make sure you are using VirtueMart 2, as that is what this guide pertains to. VM3 is a bit different.

admin 12-03-2015, 13:38

Can you send a screenshot, I am unsure of what you are saying.

Rdharma 23-05-2015, 10:48

how to show drop down list in horizontal row?

8webskin@gmail.com 27-05-2015, 20:12

problem with this is it always go to the first variance as default. You couldnt add select color as default on the dropdown and do some validation.. worst ecommerce

Vy 28-10-2015, 01:16

hi. thanks for this valuable article. It helps me to know how to make cusom filed, and set up color and size for my product.

My question is, if my product is a mixed color t shirt design, like, white body with red sleeve, red body with white sleeve, 2 designs for this t shirt.
if I set up color by white and red, it will make customer confused.
So I want to put the pecific product image into the color value, it means, the colors dont show by color icon, but show by product image.

How can I make it?


Leave a Reply