Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hello!
I'm looking for help coding some checkboxes on our store's cart screen to allow customers to tell us if whether;
a) They would be happy to allow substitutions on items when we don't have the exact thing they've ordered, or;
b) Instead of a substitution they would prefer to receive a partial or full refund on the item(s) instead.
Ideally, checking one of the two boxes would be compulsory before moving to checkout, and the option that's been checked will feed through in some way so that our fulfilment team are able to see what the customer's preference is.
Thank you for your time!
Hi @Xelbie
Would something like the below address your specific issue at hand?
If yes, copy the following code and paste it between the <form> tags inside your cart.liquid file
<p class="cart-attribute__field">
<label>Choose Your Refund Preference:</label><br>
<input required class="required" type="radio" name="attributes[Choose Your Refund Preference]" value="Allow substitutions"{% if cart.attributes["Choose Your Refund Preference"] == "Allow substitutions" %} checked{% endif %}> <span>Allow substitutions</span><br>
<input required class="required" type="radio" name="attributes[Choose Your Refund Preference]" value="Instead of a substitution they would prefer to receive a partial or full refund on the item(s)"{% if cart.attributes["Choose Your Refund Preference"] == "Instead of a substitution they would prefer to receive a partial or full refund on the item(s)" %} checked{% endif %}> <span>Instead of a substitution they would prefer to receive a partial or full refund on the item(s)</span><br>
</p>
Should you need more hands-on assistance we would be happy to provide it.
Cheers!
Hey there, thanks for your reply!
While the code above seems to work as intended on the Cart screen, the selected information doesn't appear to feed through to the customer's order information once the order has been placed. Is there any way around this?
Hi @Xelbie
Can you confirm this was placed inside your cart.liquid file between the <form> & </form> tags?
Let me know!