How to add "Ships By Date", where Date is always X days in the future

Hi everyone,

On our page, we want it to say “Ships By DATE”, where DATE is always the next shipping date. The cut off would be 10am, and we ship Monday, Wednesday and Friday.

For example:

  • if someone is on the page on a Wednesday (eg. March 15) at 11am, their shipment goes out on March 17. So we say want it to say “Ships By March 17”.
  • If someone is on the page on March 17 at 2pm, then it’ll say “Ships By March 20”.
  • If someone is on the page on March 17 at 9am, then it’ll say “Ships by March 17”.

Does anyone know if this is possible and how to do it? Also we can’t be using any CMS functionality.

Thanks

Hi Hin,

You can build the logic to calculate and display your shipping date using custom code; however-

  • If you do it as client-side Javascript, it will use the user’s own system clock to determine the current time. That may be wrong and give incorrect results. To avoid this, you could build this server-side. You could use n8n or Pipedream, or write a serverless lambda on e.g. Netlify.

  • Timezones. Depending on where your user is, you need to account for their local time difference. Server-side also overcomes this however you’ll want to make you’re language clear e.g. “Orders before 11am PST will be shipped on the next shipping day ( click for details ).”

  • Cutoff time. If they start the order at 10:58 am, they’ll see a different shipping date. I think clear langage is the best way to mediate that confusion.

If you don’t have any devs, feel free to PM me and I’ll give you a quote.