Hi
I want to add an “Order number” field under the Phone number field on the Contact us page. Can someone help me?
Btw, I’m using Dawn theme.
A user seeks to add an “Order number” field below the phone number field on their Dawn theme contact form page.
Solution Provided:
contact.liquid file (positioned after the phone number field section)en.default.json translation file with the label “order number”Implementation Issues:
Status: The discussion remains open with unresolved formatting and error issues, though the basic implementation approach has been outlined with code snippets and visual examples.
Hi
I want to add an “Order number” field under the Phone number field on the Contact us page. Can someone help me?
Btw, I’m using Dawn theme.
Hello @SY_Lee
Can you please share contact.liquid code.
{{ 'section-contact-form.css' | asset_url | stylesheet_tag }}
{%- style -%}
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
}
@media screen and (min-width: 750px) {
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top }}px;
padding-bottom: {{ section.settings.padding_bottom }}px;
}
}
{%- endstyle -%}
{%- if section.settings.heading != blank -%}
## {{ section.settings.heading | escape }}
{%- else -%}
## {{ 'templates.contact.form.title' | t }}
{%- endif -%}
{%- form 'contact', id: 'ContactForm', class: 'isolate' -%}
{%- if form.posted_successfully? -%}
## {% render 'icon-success' %} {{ 'templates.contact.form.post_success' | t }}
{%- elsif form.errors -%}
## {% render 'icon-error' %} {{ 'templates.contact.form.error_heading' | t }}
- {{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }}
{%- endif -%}
{%- if form.errors contains 'email' -%}
<small>
{{ 'accessibility.error' | t }}
{% render 'icon-error' %}{{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }}
</small>
{%- endif -%}
{%- endform -%}
{% schema %}
{
"name": "t:sections.contact-form.name",
"tag": "section",
"class": "section",
"settings": [
{
"type": "text",
"id": "heading",
"default": "Contact form",
"label": "Heading"
},
{
"type": "select",
"id": "heading_size",
"options": [
{
"value": "h2",
"label": "t:sections.all.heading_size.options__1.label"
},
{
"value": "h1",
"label": "t:sections.all.heading_size.options__2.label"
},
{
"value": "h0",
"label": "t:sections.all.heading_size.options__3.label"
}
],
"default": "h1",
"label": "t:sections.all.heading_size.label"
},
{
"type": "select",
"id": "color_scheme",
"options": [
{
"value": "accent-1",
"label": "t:sections.all.colors.accent_1.label"
},
{
"value": "accent-2",
"label": "t:sections.all.colors.accent_2.label"
},
{
"value": "background-1",
"label": "t:sections.all.colors.background_1.label"
},
{
"value": "background-2",
"label": "t:sections.all.colors.background_2.label"
},
{
"value": "inverse",
"label": "t:sections.all.colors.inverse.label"
}
],
"default": "background-1",
"label": "t:sections.all.colors.label"
},
{
"type": "header",
"content": "t:sections.all.padding.section_padding_heading"
},
{
"type": "range",
"id": "padding_top",
"min": 0,
"max": 100,
"step": 4,
"unit": "px",
"label": "t:sections.all.padding.padding_top",
"default": 36
},
{
"type": "range",
"id": "padding_bottom",
"min": 0,
"max": 100,
"step": 4,
"unit": "px",
"label": "t:sections.all.padding.padding_bottom",
"default": 36
}
],
"presets": [
{
"name": "t:sections.contact-form.presets.name"
}
]
}
{% endschema %}
@SY_Lee
Put below code in contact-form.liquid as shown in below image
Add ordernumber in en.default.json file : “order”: “order number”, as show in below image
So order number field will be added underneath of mobile number.
Yo, made the same but has different design. How can I make similar to all?
Fixed(27.08) with the reply of Ujjaval