News:

Support the VirtueMart project and become a member

Main Menu

[solved] Add own dropdown list field to VM products in Backend

Started by gba, August 27, 2014, 16:53:57 PM

Previous topic - Next topic

gba

Hello all!

In the backend there are several fields with multiselect dropdown, like i.e. categories, manufacturers, shopper groups.
Now I want to add an own field 'View groups' in this style, containing just strings, maybe separated by i.e. '|'.

In the file '/administrator/components/com_virtuemart/views/product/tmpl/product_edit_information.php' I added following code after the last TR for product information:
<?php $i $i?>
<tr class="row<?php echo $i?>">
<td>View groups</td>
<td>
<select class="inputbox" id="viewgroups" name="viewgroups[]" multiple="multiple"  data-placeholder="<?php echo vmText::_('COM_VIRTUEMART_DRDOWN_SELECT_SOME_OPTIONS')  ?>" size="10">
<option value=""><?php echo vmText::_('COM_VIRTUEMART_UNCATEGORIZED'?></option>
<option value="1">Option1</option>
<option value="2">Option2</option>
<option value="3">Option3</option>
<option value="4">Option4</option>
<option value="5">Option5</option>
<option value="6">Option6</option>
</select>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>


In the backend the field works as all the others of this type: Choose an option -> the option is added to the field and not available in the list anymore.

So, what I didn't find out, yet:
1. How can I store the chosen options with the product?
2. How can I display them i.e. on the product details page?
3. How can I add this field without changing the VM core?

Thank you very much in advance for any helpful hint!

Kind regards,
Gerald ???

gba

Hi all!

Solution: Use a VM custom field plugin.  :)

Best regars,
Gerald

Milbo

Not even a plugin, just customfield String, and "is a list"
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

gba

Hi!

Yes, that works for generating simple selectboxes in the frontend.  :)
What I needed, was a multiple selectbox in vm-chzn style in the product backend.

Best regards,
Gerald

Milbo

use the custom, not product customfield. I mean the prototype of them, the custom itself. Use "is_list" there and do NOT select "is input", then you get a list for the BE, to select fixed values to display them in the FE.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/