I don't know Javascript or PHP and I've tried my best finding an answer online but without the basic knowledge I have no clue how to do this. I am sure there are many people like me who are stuck.
My situation is that I need to insert a delivery date by somehow fetching the current date and adding 7 days to it, then input it to the "YYYY-MM-DD" field in the code below.
The best answer I've found is here but I have no clue how to implement it
This is the full code, please help me figure out how to structure it:
<!-- BEGIN GCR Opt-in Module Code -->
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn"
async defer>
</script>
<script>
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
window.gapi.surveyoptin.render(
{
// REQUIRED
"merchant_id":"xxxxxxxxxx",
"order_id": "{BOOKINGNUMBER}",
"email": "{EMAIL}",
"delivery_country": "ISO 3166-2:CA",
"estimated_delivery_date": "YYYY-MM-DD",
// OPTIONAL
"opt_in_style": "CENTER_DIALOG"
});
});
}
</script>
<!-- END GCR Opt-in Module Code -->