Shopify Delivery Date Picker - turn off days

岁酱吖の 提交于 2019-12-14 03:14:40

问题


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.


回答1:


You can adjust the min and max dates in your delivery-date.liquid snippet.

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"
} );

See the jQuery UI docs for more info on minDate and maxDate.

You can also disable weekends:

jQuery("#date").datepicker( { 
  minDate: +7, 
  maxDate: "+2M",
  beforeShowDay: $.datepicker.noWeekends
} );

...or disable specific days.



来源:https://stackoverflow.com/questions/24966073/shopify-delivery-date-picker-turn-off-days

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!