Can I calculate a date based on users selected options?

Hi,

I need to add an option to my store for users to select the “first day” on their product. The product will have a duration option too (1 day, 2 days etc). I would like to calculate a finish date based on the users “first day” + “duration of days”. For example, if the first day was 02/09/21 and the duration was 3 days then the finish date would be 05/09/21.

The “first day” doesn’t need to be an option really as the product variant availability is not based on it. In an ideal world it would just be an extra field on the product page that has to be completed (as I’ve already got 3 product options and ideally don’t want to have to use a third party app to have more).

Can anyone point me in the right direction?

Thanks

@Ash110 ,

Use a line_item_properties or meta field to show the first date and duration. Create a simple jquery/JS to display the date after calculations. Customization will be needed on product page

Thanks for your reply - I’ll have a look into this!

Would it also be possible for the checkout to display the dates and for each product variant with different dates to be shown as it’s own order item?

Yes, it will be possible to show this in cart and and checkout as additional line item