Shopify交货日期选择器-关闭日期 [英] Shopify Delivery Date Picker - turn off days
问题描述
我将此代码添加到我的shopify网站 http://docs.shopify.com/manual/configuration/store-customization/page-specific/cart-page/capture-delivery-date .效果很好,但我想不通如何关闭电源.我没有整夜甚至两天送达,因此我想禁止客户选择今天日期和接下来的7天之间的日期.
I added this code to my shopify site http://docs.shopify.com/manual/configuration/store-customization/page-specific/cart-page/capture-delivery-date. It works great, but I can't figure out how to turn off some days. I don't deliver overnight or even 2 day, so I want to disable the ability for customers to choose days that are today's date + the following 7 days.
推荐答案
您可以在 delivery-date.liquid 代码段中调整最小和最大日期.
You can adjust the min and max dates in your delivery-date.liquid snippet.
要将最短日期设置为今天的日期+ 7天(而不是所提供的示例代码中的+1天):
To set the minimum date to today's date + 7 days (instead of +1 day in the sample code provided):
jQuery("#date").datepicker( {
minDate: +7,
maxDate: "+2M"
} );
您还可以禁用周末:
jQuery("#date").datepicker( {
minDate: +7,
maxDate: "+2M",
beforeShowDay: $.datepicker.noWeekends
} );
...或禁用特定日期.
这篇关于Shopify交货日期选择器-关闭日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!