VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: charlwilliam on June 05, 2012, 07:57:39 AM

Title: How to add new fields for products in the Administration Area in Virtuemart 2
Post by: charlwilliam on June 05, 2012, 07:57:39 AM
I wanted to find out the right way to go about adding new fields in the backend for products in Virtuemart 2. I found a helpful article on the web http://indiestechtips.wordpress.com/2011/12/24/how-to-add-new-field-in-virtuemart-2-0/  (http://indiestechtips.wordpress.com/2011/12/24/how-to-add-new-field-in-virtuemart-2-0/), I have added my custom fields but the problem is that it only works when updating a product, when you add a product none of your newly added fields will save to the database.

Is there a step they have missed in the linked article

Thanks
Title: Re: How to add new fields for products in the Administration Area in Virtuemart 2
Post by: charlwilliam on June 06, 2012, 08:20:21 AM
Hi there

I eventually found the problem, after adding your new fields to product_edit_information.php you must add the new fields here:

administrator\components\com_virtuemart\tables\products.php

Add new variable with your field name eg.

var $your_field;
Title: Re: How to add new fields for products in the Administration Area in Virtuemart 2
Post by: Joe Bourque on August 10, 2012, 18:55:01 PM
I added the var like you stated but still does not save info to the database
Title: Re: How to add new fields for products in the Administration Area in Virtuemart 2
Post by: Lordmodkore on November 15, 2012, 07:37:31 AM
I happen to make it work, Added a new field on the backend and was able to save it to my database. My problem is how can i retrieve that new field from the database to be display into my cart.
Title: Re: How to add new fields for products in the Administration Area in Virtuemart 2
Post by: Lordmodkore on November 15, 2012, 10:36:22 AM
Anyone encounter the same problem?