- Getting Started
- Liquid reference
- Filters reference
- Tags reference
- Localization
- Theme structure
- Theme sections
- Theme assets
- Theme config
- Theme layout
- Theme templates
-
- article.liquid
- blog.liquid
- cart.liquid
- collection.liquid
- customer/account.liquid
- customer/addresses.liquid
- customer/details.liquid
- customer/login.liquid
- customer/order.liquid
- customer/register.liquid
- customer/reset-password.liquid
- home.liquid
- page.no-heading.liquid
- products.liquid
- search.liquid
- list-collections.liquid
- store-locator.liquid
- 404.liquid
- customer/activate_account.liquid
- customer/orders.liquid
- Submission
attribute_setting
The attribute_setting object represents a single custom attribute field, such as a custom field collected when a customer registers. The available fields come from shop.attribute_settings, which you loop over to render each field.
{% for attribute_setting in shop.attribute_settings %}
{{ attribute_setting.title }}
{% endfor %}
The attribute_setting object has the following attributes:
attribute_setting.id
Returns the unique ID of the custom attribute field. This is commonly used to build the field's name and id attributes.
<input name="customer[attributes][{{ attribute_setting.id }}]">
attribute_setting.title
Returns the title (label) of the custom attribute field.
attribute_setting.input_type
Returns the input type of the field, for example dropdown or date. Use it to decide which form control to render.
{% if attribute_setting.input_type == "dropdown" %}
<select>...</select>
{% endif %}
attribute_setting.is_required
Returns true if the field is required, otherwise false.
<input {% if attribute_setting.is_required %}required{% endif %}>
attribute_setting.options
Returns an array of the available options for a dropdown field. Each option has a value.
{% for option in attribute_setting.options %}
<option value="{{ option.value }}">{{ option.value }}</option>
{% endfor %}
attribute_setting.value
Returns the value saved for the custom attribute field.