Shopify themes, liquid, logos, and UX
I hope everyone is doing well.
Can someone help me add a text field for Name and contact number under "Your Contact information".
Thank you everyone
Hi @raprapskie , it's Layoutbase here.
We would like to provide you with our thoughts on your question.
The plus plan is required to perform the mentioned adjustment. Other plans can’t do it.
Instructions are as below:
1. Go to Online Store->Theme->Edit code
2. Layout/checkout.liquid -> add code below before </head> tag
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
3. Go to Layout/checkout.liquid -> add code below before </body> tag
<script>
const NAME = '';
const PHONE_NUMBER = '';
var addCustomField = function () {
let nameField = `<div class="field"><div class="field__input-wrapper custom" id="name-field"><label class="field__label field__label--visible" for="contact-name">Name:</label>
<input data-is-error="true" data-custom-input="true" placeholder="Name" value="${NAME}" autocorrect="off" class="field__input" aria-required="true" type="text" name="checkout[attributes][Contact Name]" id="contact-name" >
</div></div>`;
let phoneField = `<div class="field"><div class="field__input-wrapper custom" id="phone-field"><label class="field__label field__label--visible" for="phone-number">Number Phone:</label>
<input data-is-error="true" data-custom-input="true" placeholder="Number Phone" value="${PHONE_NUMBER}" autocorrect="off" class="field__input" aria-required="true" type="text" name="checkout[attributes][Phone Number]" id="phone-number">
</div></div>`;
$('.section--contact-information .fieldset').prepend(phoneField);
$('.section--contact-information .fieldset ').prepend(nameField);
};
addCustomField();
</script>
Hope you find our suggestion helpful.
Best regards,
Layoutbase
Please let us know if you find it helpful by giving us a LIKE and Mark as Solution.
Layoutbase is a leading Shopify page builder. Give us a try HERE!
Thank you for your help, if we get the shopify plus, I will try this one.
Hi,
can you give me also the snippet to just add a static text above the ATC button? It also should be able to be translated.
thanks!
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024