How to add New field in Virtuemart 2.0?

If you need an additional field for your own business requirement, you can do that by changing data model as well as some php code.
To add new field for product you have to make changes in php code of 3 or more separate files in the previous Virtuemart joomla 1.5 but in virtuemart 2.0 and joomla 1.7 version you only have to make change in only one file to add field.

Admin interface

To add field in virtuemart admin side, first you have to create field in your product table into database then you need to add field for product in virtuemart.
Follow this path from your site root
File Name: product_edit_information.php for product
Add this type of code wherever you want to put new field.

<td width="21%" >[Your_Field_Name] </td>
<td >
<input type="text" class="inputbox" name="Your_Field_Name" value="<?php echo $this->product-> Your_Field_Name; ?>" size="32" maxlength="64" />

I hope this will help you.

Posted in Joomla. 3 Comments »

3 Responses to “How to add New field in Virtuemart 2.0?”

  1. narsdfs Says:

    when I add another field.. system denied to save another variable. I really dont know why 🙂 sameone know how to solve it?

  2. Charl Says:

    Hi there
    Thanks for this useful piece of code, I found that when adding a new product the new field does not update in the database. However it DOES save to the database when updating a product.
    Do you have a workaround for this

  3. darmowy precel Says:

    Hi to every body, it’s my first pay a quick visit of this website; this weblog carries remarkable and really good stuff in favor of visitors.

Speak Your Mind

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: