Personalized checkout and custom promotions with Shopify Scripts
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.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024