Personalized checkout and custom promotions with Shopify Scripts
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
Code in cart-template:
{% for item in cart.items %}
{% if item.product.metafields.my_fields.delivery_selector %}
{% render 'delivery-date' %}
{% break %}
{% endif %}
{% endfor %}
Code in delivery-date.liquid:
<div style="width:300px; clear:both;">
<p class="cart-attribute__field">
<label for="date">Pick a delivery date:</label>
<!--input id="date" required class="required" type="text" !-->
<input name="attributes[Delivery Date]" id="date" placeholder="DEIN LIEFERDATUM" value="{{ cart.attributes.date }}">
</p>
</div>
<script>
$("#date").datepicker({
minDate: "+2d",
beforeShowDay: function(date) {
var day = date.getDay();
return [(day != 6 && day != 0 && day != 1)];
}
})
</script>
For some reason the code is not working. I am not recieving delivery date in the orders additional info
Solved! Go to the solution
This is an accepted solution.
This is an accepted solution.
@tahwar
i think code is almost perfect,
But what's the major issues?
idk what happend but it's working now lol.