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.
idk what happend but it's working now lol.
User | RANK |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023