Answer the question
In order to leave comments, you need to log in
How to make custom field in joomla component?
I am writing an extension for VirtueMart 3, there was a need to exclude some categories from processing.
To select these some categories, I want to add a field in the component settings in which you can select them.
at the moment there is an idea to create a category type field, but there is a problem how to transfer categories from the VM there - I can’t figure it out.
or the SQL field type, but there is a problem of selecting category names from the table.
The VM stores the category names in the table #__virtuemart_categories_ (here is the slug of the current language), for example, for Russian - #__virtuemart_categories_ru_ru,
as if for a specific language, you can stupidly make a field like this:
<field
name="exCAT"
type="sql"
class="inputbox"
key_field="virtuemart_category_id"
value_field="category_name"
query="SELECT virtuemart_category_id, category_name FROM #__virtuemart_categories_ru_ru"
label="Выберите категории, которые нужно исключить"
description=""
multiple="true"
/>
Answer the question
In order to leave comments, you need to log in
The easiest way is to write your own field type. You can do whatever you want in it. Here is the manual https://docs.joomla.org/Creating_a_custom_form_fie...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question