27258

Shopify Delivery Date Picker - turn off days

Question:

I added this code to my shopify site <a href="http://docs.shopify.com/manual/configuration/store-customization/page-specific/cart-page/capture-delivery-date" rel="nofollow">http://docs.shopify.com/manual/configuration/store-customization/page-specific/cart-page/capture-delivery-date</a>. 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.

Answer1:

You can adjust the min and max dates in your <strong>delivery-date.liquid</strong> 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 <a href="http://api.jqueryui.com/datepicker/#option-minDate" rel="nofollow">minDate</a> and <a href="http://api.jqueryui.com/datepicker/#option-maxDate" rel="nofollow">maxDate</a>.

You can also <a href="http://api.jqueryui.com/datepicker/#utility-noWeekends" rel="nofollow">disable weekends</a>:

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

...or <a href="http://tokenposts.blogspot.ca/2011/05/jquery-datepicker-disable-specific.html" rel="nofollow">disable specific days</a>.

Recommend

  • What's going on with python 3k? [closed]
  • RowNumber() and Partition By performance help wanted
  • Deleting remote .csv files with timestamp in their names older than 2 days
  • flyway clean is not dropping scheduler jobs or programs
  • Auto Pop Up Save As Window For Firefox
  • How to populate listview with a lot of information without blocking?
  • Additional paypal fee on Woocommerce checkout page
  • Save new value to Laravel session array
  • How to show “regular price” instead of a “discounted price” on mini-cart (Woo)
  • Difference between AUTO_ACKNOWLEDGEMENT mode with and without Spring JMS
  • PHP “mail()” function sends mail from php5 cli but not when the script is run by a browser
  • What's a good way to make a one-shot KVO observation?
  • iPhone: 5 seconds video capture
  • Printing out Japanese (Chinese) characters
  • oracle row contention causing deadlock errors in high throughtput JMS application
  • Rx produce and consume on different threads
  • three.js WebVR example code works on threejs.org but not on my local server
  • Organizing large javascript files [closed]
  • SQL - Select lowest values with group by and order by?
  • Available space left on drive - WinAPI - Windows CE
  • Cypher - matching two different possible paths and return both
  • cell spacing in div table
  • XSLT foreach repeating nodes to flat
  • How to create a 2D image by rotating 1D vector of numbers around its center element?
  • Thread 1: EXC_BAD_ACCESS (code =1 address = 0x0)
  • How to access culture data in globalize.js V1.0.0
  • Android application: how to use the camera and grab the image bytes?
  • Date Conversion from yyyy-mm-dd to dd-mm-yyyy
  • print() is showing quotation marks in results
  • formatting the colorbar ticklabels with SymLogNorm normalization in matplotlib
  • Illegal mix of collations for operation for date/time comparison
  • Ajax jQuery multiple calls at the same time - long wait for answer and not able to cancel
  • How to recover from a Spring Social ExpiredAuthorizationException
  • Incrementing object id automatically JS constructor (static method and variable)
  • ILMerge & Keep Assembly Name
  • Release, debug version and Authorization Google?
  • Large data - storage and query
  • WOWZA + RTMP + HTML5 Playback?
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • Hits per day in Google Big Query