TransWikia.com

pass cart fields on checkout

Craft CMS Asked by glider on June 8, 2021

I have a notes field shown on the cart page. When a customer fills the field out and clicks "Checkout" the contents are not saved. Same goes for Quantity or other custom fields. If "Update Cart" is chosen the data is saved. Is there any way to prevent the checkout from continuing if these fields have content? Or would this need to be done via something like javascript validation?

<form method="POST">
    <input type="hidden" name="action" value="commerce/cart/update-cart">
    <input type="hidden" name="cartUpdatedNotice" value="The cart was updated.">
    {{ redirectInput('shop/cart') }}
    {{ csrfInput() }}
    ...
   <textarea type="text" name="lineItems[{{ item.id }}][note]" value="{{ item.note }}">{% if item.note %}{{ item.note }}{% else %}{% endif %} </textarea>

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP