Ecommerce Shopify WordPress Discussion

Add required date picker to shopify product page

I added a date input as block to a Shopify product template. It works and the data addeed to it appears in the properties of the product, when in cart and ordered. But I can't get the input to be required here. Important to note: This ist NOT to add a delivery date. The product is a course and the buyer need to choose the date of participation. I've added the required attribute to the input element and also added an required as class. Markup in main-product.liquid <date-picker class="date_picker"> <label for="course-date-{{ }}" class="date_picker__label form__label" > {{- 'products.product.course_date' | t -}} </label> <div class="date_picker__input-wrapper"> <input type="date" id="course-date-{{ }}" class="required date_picker__input" name="properties[Kursdatum]" min="{{ block.settings.season_date_start }}" max="{{ block.settings.season_date_end }}" form="{{ product_form_id }}" required /> </div> </date-picker>
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.