Skip to content

getContactAdditionalFields(int items_per_page)

The getContactAdditionalFields method is used to get a AdditionalFieldsList object that represents list of contact form additional fields in the storefront.

Input parameters

items_per_page

int Number of items in a page of internal paginator. Parameter is optional. Default value is 10.

Returned value

The AdditionalFieldsList object.

Example

TODO

source
{% set contact = ObjectApi.getContactAdditionalFields() %}
{% for field in contact %}
    {% if field.isCheckbox %}
        <input type="checkbox" {% if field.isChecked %}checked{% endif %}>
    {% elseif field.isHidden %}
        <input type="hidden" />
    {% elseif field.isInfo %}
        <p>{{ field.name }}</p>
    {% elseif field.isText %}
        <input type="text" {% if field.isRequired %}required{% endif %}>
    {% elseif field.isSelect %}
        <select {% if field.isRequired %}required{% endif %}>
            <option></option>
            {% for option in field.options %}
                <option value="{{ option.id }}">{{ option.name }}</option>
            {% endfor %}
        </select>
    {% endif %}
{% endfor %}
output
<input type="checkbox" checked>
<input type="hidden" />
<p>Additional information in contact form.</p>
<input type="text" required>
<select required>
    <option></option>
    <option value="111">Cooperation</option>
    <option value="222">Complaint</option>
</select>