Developers
Fields
Custom fields and how to work with them.
J2Commerce provides 44 custom Joomla form field types that extend Joomla's form system. These fields handle everything from entity lookups and product pricing to image uploading and SEF router configuration. Third-party plugins, modules, and extensions can use any of these fields in their XML forms.
Using J2Commerce Fields
All fields live in the J2Commerce\Component\J2commerce\Administrator\Field namespace. Declare addfieldprefix on your form XML:
<form addfieldprefix="J2Commerce\Component\J2commerce\Administrator\Field">
<fieldset name="basic">
<field name="country_id" type="Country" label="Country" />
<field name="zone_id" type="Zone" label="Zone" country_field="country_id" />
</fieldset>
</form>
For plugin manifests:
<config>
<fields name="params" addfieldprefix="J2Commerce\Component\J2commerce\Administrator\Field">
<field name="tax_profile" type="Taxprofile" label="Tax Profile" />
</fields>
</config>
Modal fields use a sub-namespace and require a separate prefix:
<field name="product_id" type="Modal_Product"
addfieldprefix="J2Commerce\Component\J2commerce\Administrator\Field\Modal" />
Entity Lookup Fields
Dropdown fields populated from J2Commerce database tables. All extend ListField.
| Field Type | Class | Table | Stored Value |
|---|---|---|---|
Country | CountryField | #__j2commerce_countries | j2commerce_country_id (int) |
Zone | ZoneField | #__j2commerce_zones | j2commerce_zone_id (int) |
GeoZone | GeoZoneField | #__j2commerce_geozones | j2commerce_geozone_id (int) |
Currencies | CurrenciesField | #__j2commerce_currencies | currency_code (string) |
OrderStatus | OrderStatusField | #__j2commerce_orderstatuses | j2commerce_orderstatus_id (int) |
Orderstatustype | OrderstatustypeField | #__j2commerce_orderstatuses | orderstatus_type (string) |
Taxprofile | TaxprofileField | #__j2commerce_taxprofiles | j2commerce_taxprofile_id (int) |
TaxRate | TaxRateField | #__j2commerce_taxrates | j2commerce_taxrate_id (int) |
Manufacturers | ManufacturersField | #__j2commerce_manufacturers | j2commerce_manufacturer_id (int) |
Vendors | VendorsField | #__j2commerce_vendors | j2commerce_vendor_id (int) |
Length | LengthField | #__j2commerce_lengths | j2commerce_length_id (int) |
Weight | WeightField | #__j2commerce_weights | j2commerce_weight_id (int) |
StoreProfile | StoreProfileField | #__j2commerce_storeprofiles | j2commerce_storeprofile_id (int) |
ManufacturerCountry | ManufacturerCountryField | #__j2commerce_countries (filtered) | j2commerce_country_id (int) |
VendorCountry | VendorCountryField | #__j2commerce_countries (filtered) | j2commerce_country_id (int) |
Product & Pricing Fields
Fields for product configuration, pricing, and commerce settings.
| Field Type | Class | Purpose |
|---|---|---|
ProductType | ProductTypeField | Product type selector (simple, configurable, variable, etc.) |
PriceCalculator | PriceCalculatorField | Pricing calculator strategy selector |
VariantPrice | VariantPriceField | Currency-prefixed price input for variants |
VariantAdvancedPricing | VariantAdvancedPricingField | Button to open advanced pricing modal |
Dimensions | DimensionsField | Three-input group for length/width/height |
PaymentMethods | PaymentMethodsField | Installed payment plugin selector |
ShippingMethods | ShippingMethodsField | Installed shipping plugin/method selector |
Invoicetype | InvoicetypeField | Document type selector (invoice, receipt, packing slip) |
Modal Picker Fields
Modal-based entity selection fields.
| Field Type | Class | Purpose |
|---|---|---|
Modal_Product | Modal\ProductField | Single product picker via modal |
Modal_ProductMultiselect | Modal\ProductMultiSelectField | Multi-product picker via modal |
Multi-Select & List Fields
Advanced selection fields with dual-panel or checkbox interfaces.
| Field Type | Class | Purpose |
|---|---|---|
Duallistbox | DuallistboxField | Two-panel multi-select listbox |
CategoryDuallistbox | CategoryDuallistboxField | Dual listbox pre-loaded with Joomla categories |
PhoneCountries | PhoneCountriesField | Country checkbox grid with dial codes |
Template & Layout Fields
Fields for template selection and layout configuration.
| Field Type | Class | Purpose |
|---|---|---|
Subtemplate | SubtemplateField | Visual card picker for app subtemplates |
Templatelist | TemplatelistField | Template folder dropdown with plugin event support |
TemplateCustom | TemplateCustomField | Display-only shortcode reference panel |
Categoryj2commerce | Categoryj2commerceField | Bootstrap accordion of category settings panels |
Image & File Fields
Fields for image uploading and directory selection.
| Field Type | Class | Purpose |
|---|---|---|
J2CommerceImage | J2CommerceImageField | Single image picker with preview |
MultiImageUploader | MultiImageUploaderField | Uppy-powered drag-and-drop multi-image uploader |
ImageDirectory | ImageDirectoryField | Folder picker rooted at images/ |
Router & Menu Fields
Fields for SEF URL routing configuration.
| Field Type | Class | Purpose |
|---|---|---|
Routertype | RoutertypeField | Hidden field exposing router type for showon conditions |
RouterCategory | RouterCategoryField | Category field that auto-switches by router mode |
RouterModalCategory | RouterModalCategoryField | Modal/multi-select category field by router mode |
Productlistmenu | ProductlistmenuField | Menu item selector for legacy router |
Display & Utility Fields
Read-only display fields and UI utilities. These fields render information but store no data.
| Field Type | Class | Purpose |
|---|---|---|
Alert | AlertField | Bootstrap alert box (display only) |
Button | ButtonField | Clickable button with onclick handler |
Price | PriceField | Alert variant for pricing contexts |
Cronlasthit | CronlasthitField | Cron last execution status display |
Queuekey | QueuekeyField | Queue key display with AJAX regenerate |
Key Notes
- CurrenciesField stores an ISO string (
USD), not an integer ID — unique among entity fields. - ZoneField supports AJAX country-linking via the
country_fieldattribute. - ManufacturerCountry/VendorCountry are filtered variants of
CountryField— ideal for filter forms. - Router fields work together:
RoutertypeFielddrivesshowonconditions forRouterCategory,RouterModalCategory, andProductlistmenu. - Display fields (Alert, Button, Price, Cronlasthit, TemplateCustom) render UI elements but never appear in POST data.
Documentation (43)
-
AlertField
AlertField renders a Bootstrap alert box inside a Joomla admin form. It is a display-only field — it stores no data and submits nothing. Use it to present…
-
CategoryDuallistboxField
CategoryDuallistboxField extends DuallistboxField and automatically populates the Available panel with all published Joomla com_content categories. Hierarchy…
-
Categoryj2commerceField
Categoryj2commerceField is a SpacerField subclass that renders a Bootstrap 5 accordion on the Joomla category edit form. Each accordion panel contains a…
-
CountryField Field Type
CountryField extends Joomla's ListField to render a element populated with every enabled country from #__j2commerce_countries. Options are ordered…
-
CronlasthitField
CronlasthitField is a display-only field that reads the cron_last_trigger parameter from the J2Commerce component configuration and renders a Bootstrap alert…
-
CurrenciesField Field Type
CurrenciesField extends Joomla's ListField to render a populated with every enabled currency from #__j2commerce_currencies. Each option displays the currency…
-
Dimensions Form Field
DimensionsField is a FormField subclass that renders three decimal inputs — Length, Width, and Height — combined into a single Bootstrap 5 input-group. This…
-
DuallistboxField
DuallistboxField renders a two-panel listbox widget that lets users move items between an "Available" list and a "Selected" list. It extends Joomla's…
-
GeoZoneField Field Type
GeoZoneField extends Joomla's ListField to render a populated with every enabled geo-zone from #__j2commerce_geozones. Geo-zones group geographic regions…
-
ImageDirectoryField
ImageDirectoryField extends Joomla's built-in FolderlistField to produce a dropdown list of directories rooted at the Joomla images/ folder. The root images…
-
Invoicetype Form Field
InvoicetypeField is a ListField subclass that renders a dropdown of document types used when creating invoice templates. Three types are built in: invoice,…
-
J2CommerceImage Form Field
J2CommerceImageField is a lightweight inline image picker for J2Commerce admin forms. It renders a row of fixed-size thumbnails with an Add Image button that…