Jump to content

Recommended Posts

Hi Guys,

 

I need to add some code to my order confirmation page for Google customer review opt in, shown below.   Can someone tell me what file I should be adding it to.

 

I have tried the order_confirmation.tpl with no luck

 

Thanks in advance 

 

 

 

<script src="#ttps://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>

<script>
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
window.gapi.surveyoptin.render(
{
"merchant_id": 000000000,
"order_id": "ORDER_ID",
"email": "CUSTOMER_EMAIL",
"delivery_country": "COUNTRY_CODE",
"estimated_delivery_date": "YYYY-MM-DD"
});
});
}
</script>

Edited by grandall1069 (see edit history)
Link to comment
Share on other sites

You need to edit the orderConfirmationController, and add the parameters to the template, first.
Delivery date should be more or less the time it usually takes for you to deliver goods.
If it's variable, you will have to consider the shipping time for each carrier.

Link to comment
Share on other sites

the correct way is to create a module that would hook the orderConfirmation event.

 

the module would be responsible for setting the 4 values you need, and then displaying the content on the order confirmation page.

 

The first 3 values should be fairly easy to obtain

"order_id": "ORDER_ID",
"email": "CUSTOMER_EMAIL",
"delivery_country": "COUNTRY_CODE",

However delivery date does not exist in core Prestashop, are you using a module or customization for this?

"estimated_delivery_date": "YYYY-MM-DD"
Link to comment
Share on other sites

@nemops, I assume it does too, however my question is not about the google ad script, it is about Prestashop.  Prestashop does not capture an estimated delivery date in core, so I'm wondering how they have added that to Prestashop. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...