For this customization to work, some themes require that a script tag for jQuery is added to the theme.liquid layout file. If you use Boundless, Debut version 17.2.0 or newer, Express, Narrative, or Venture, then you might need to follow the next step:
In the Layout directory, click theme.liquid.
Find the closing </head> tag in the code. On a new line above the closing </head> tag, paste the following code:
Click Save.
Create a delivery date snippet
From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, click the … button to open the actions menu, and then click Edit code.
In the Snippets directory, click Add a new snippet:
Create the snippet:
Name your snippet delivery-date.
Click Create snippet. The new snippet file will open in the code editor.
In your new delivery-date.liquid snippet, paste the following code:
Click Save.
Include the snippet in your cart page
To include the delivery date snippet in your cart page:
In the Sections directory, click cart-template.liquid. If your theme doesn't have this file, then click cart.liquid in the Templates directory.
Find the closing </form> tag in the code. On a new line above the closing </form> tag, paste the following code:
Click Save.
You now have a delivery date input field on your cart page. When you click inside the text field, a calendar will appear:
The date picker used in this customization is a widget from the jQuery UI library. This blog post explains how to disable specific dates in the date picker calendar.
Can’t find the answers you’re looking for? We’re here to help.