2

I am using joomla 3.x with VirtueMart.

I am trying to add a custom field "Country of Origin" to a product. It would be the best that I can make use of the country list provided by VirtueMart.

How can I accomplish that?

  • 2
    Sorry, I am new to joomla. Instead of just minus my question, why don't you give me a little bit of suggestions on how to solve my problem? – Tony Leung Oct 9 '14 at 11:08
3

Try this,

Components -> Virtuemart -> Products -> Custom Fields -> create new filed as new List option

Then select it in product details page custom fields section

Assume that you are using VM2.x

Hope it helps..

  • Thanks! I am using vm2.x. I can now add a custom field and make it a dropdown list. But is there any way I retrieve the default values from database? – Tony Leung Oct 9 '14 at 12:08
  • Once saved on product details page it will load the default value correctly for that product in adminside right ? – Jobin Jose Oct 9 '14 at 12:20
1

Copy and past this code in to your XML file in the following directory:

administrator\components\com_helloworld\models\forms\helloworld.xml

<field 
    name="greeting"
    type="category"
    extension="com_helloworld"
    class="inputbox"
    default=""
    label="Day"
    description="COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC"
>
    <option value="Plese select 'DAY'">--select days--</option>
    <option value="Monday">Monday</option>
    <option value="Tuesday">Tuesday</option>
    <option value="Wednesday">Wednesday</option>
    <option value="Thursday">Thursday</option>
    <option value="Friday">Friday</option>
    <option value="Saturday">Saturday</option>
    <option value="Sunday">Sunday</option>
</field>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.