Hi @Giftshop-Digita
You can add a delivery date selector to your product page by adding a date input field. Here’s how you can do it:
1. Delivery Date Selector
Step 1: Add the Date Picker HTML to Your Product Page
-
Go to your Shopify admin and navigate to Online Store > Themes.
-
In the Sections folder, find the file named product-template.liquid (or main-product.liquid depending on your theme).
-
Look for the {% form %} or that adds the product to the cart. Inside this form, add the following HTML for the date picker:
Step 2: Capture the Selected Date
To capture and pass this date to the cart, you need to include it as a line item property. Add the below code to the form
Then, use JavaScript to update this hidden input field whenever the user selects a date:
Step 3: Display the Delivery Date in the Cart and Checkout
- Go to the cart.liquid file (found under Templates or Sections).
- Find the loop that displays cart items, and add the following code to display the selected delivery date:
{% for p in item.properties %}
{% if p.first == 'Delivery Date' %}
**Delivery Date:** {{ p.last }}
{% endif %}
{% endfor %}
2. City Selector Covering All Cities in the 7 Emirates of the UAE
You can create a dropdown selector for cities by manually adding the cities as options.
Step 1: Add the City Selector HTML
In the same product-template.liquid file, add the following HTML code in form tag:
Step 2: Display the Selected City in the Cart and Checkout
Similar to the delivery date, you can display the selected city in the cart:
{% for p in item.properties %}
{% if p.first == 'City' %}
**City:** {{ p.last }}
{% endif %}
{% endfor %}
By following the above steps, you can add a Delivery Date Selector and a City Selector to your Shopify product pages without needing third-party apps.
Thank you.
D.P,