Aleksey19881988 Posted February 9, 2021 Share Posted February 9, 2021 How to install the Google Customer Reviews code PS 1.7. Has anyone done this? <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 FIELDS "merchant_id": 115457805, "order_id": "ORDER_ID", "email": "CUSTOMER_EMAIL", "delivery_country": "COUNTRY_CODE", "estimated_delivery_date": "YYYY-MM-DD", // OPTIONAL FIELDS "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}] }); }); } </script> I understand you need to insert variables from Prestashop: ORDER_ID CUSTOMER_EMAIL COUNTRY_CODE YYYY-MM-DD Link to comment Share on other sites More sharing options...
ComGrafPL Posted February 15, 2021 Share Posted February 15, 2021 I tried to put it in order-confirmation.tpl with no luck. Blank page. Tried also with <!-- BEGIN GCR Opt-in Module Code --> and same fail. Link to comment Share on other sites More sharing options...
Aleksey19881988 Posted February 16, 2021 Author Share Posted February 16, 2021 Can anyone tell me? Link to comment Share on other sites More sharing options...
ComGrafPL Posted February 16, 2021 Share Posted February 16, 2021 1 hour ago, Aleksey19881988 said: Can anyone tell me? I have found some solution. Find file "order-confirmation-table.tpl" At the end add this code: ( in merchant id, instead of 000000, place your merchant center id ) Also in delivery country place your country code i.e FR, DE etc <script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script> {literal} <script> window.renderOptIn = function() { window.gapi.load('surveyoptin', function() { window.gapi.surveyoptin.render( { // REQUIRED FIELDS "merchant_id": 00000000, "order_id": "{/literal}{$smarty.get.id_order}{literal}", "email": "{/literal}{$customer.email}{literal}", "delivery_country": "PL", "estimated_delivery_date": "{/literal}{$smarty.now + (60*60*24*1)|date_format:"%Y-%m-%d"}{literal}", // OPTIONAL FIELDS "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}] }); }); } </script> {/literal}} Link to comment Share on other sites More sharing options...
Aleksey19881988 Posted February 16, 2021 Author Share Posted February 16, 2021 19 minutes ago, jacekgabor said: I have found some solution. Find file "order-confirmation-table.tpl" At the end add this code: ( in merchant id, instead of 000000, place your merchant center id ) Also in delivery country place your country code i.e FR, DE etc <script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script> {literal} <script> window.renderOptIn = function() { window.gapi.load('surveyoptin', function() { window.gapi.surveyoptin.render( { // REQUIRED FIELDS "merchant_id": 00000000, "order_id": "{/literal}{$smarty.get.id_order}{literal}", "email": "{/literal}{$customer.email}{literal}", "delivery_country": "PL", "estimated_delivery_date": "{/literal}{$smarty.now + (60*60*24*1)|date_format:"%Y-%m-%d"}{literal}", // OPTIONAL FIELDS "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}] }); }); } </script> {/literal}} Have you checked it? It works? Link to comment Share on other sites More sharing options...
ComGrafPL Posted February 16, 2021 Share Posted February 16, 2021 (edited) 4 minutes ago, Aleksey19881988 said: Have you checked it? It works? I did make test order and after checkout i have got google customer notification. But i will know in 1-2 days when / if email to make a review will come ( i set 1 day delivery ate in code ). So i can be sure its working 100% fine. Be sure to copy your order-confirmation-table.tpl Edited February 16, 2021 by jacekgabor (see edit history) Link to comment Share on other sites More sharing options...
Aleksey19881988 Posted February 16, 2021 Author Share Posted February 16, 2021 Well, that's great! Link to comment Share on other sites More sharing options...
Aleksey19881988 Posted February 16, 2021 Author Share Posted February 16, 2021 Do you have your own store? Link to comment Share on other sites More sharing options...
ComGrafPL Posted February 16, 2021 Share Posted February 16, 2021 (edited) 2 minutes ago, Aleksey19881988 said: Do you have your own store? Yes. But i start to implement google reviews not long ago. Edited February 16, 2021 by jacekgabor (see edit history) Link to comment Share on other sites More sharing options...
Aleksey19881988 Posted February 16, 2021 Author Share Posted February 16, 2021 similarly, we can exchange links to stores with you, maybe something will be interesting Link to comment Share on other sites More sharing options...
Aleksey19881988 Posted February 17, 2021 Author Share Posted February 17, 2021 16 hours ago, jacekgabor said: I have found some solution. Find file "order-confirmation-table.tpl" At the end add this code: ( in merchant id, instead of 000000, place your merchant center id ) Also in delivery country place your country code i.e FR, DE etc <script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script> {literal} <script> window.renderOptIn = function() { window.gapi.load('surveyoptin', function() { window.gapi.surveyoptin.render( { // REQUIRED FIELDS "merchant_id": 00000000, "order_id": "{/literal}{$smarty.get.id_order}{literal}", "email": "{/literal}{$customer.email}{literal}", "delivery_country": "PL", "estimated_delivery_date": "{/literal}{$smarty.now + (60*60*24*1)|date_format:"%Y-%m-%d"}{literal}", // OPTIONAL FIELDS "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}] }); }); } </script> {/literal}} Hello, A literal opening and closing tag shouldn't be the other way around? "order_id": "{literal}{$smarty.get.id_order}{/literal}", "email": "{literal}{$customer.email}{/literal}", "delivery_country": "PL", "estimated_delivery_date": "{literal}{$smarty.now + (60*60*24*1)|date_format:"%Y-%m-%d"}{/literal}", Link to comment Share on other sites More sharing options...
Aleksey19881988 Posted February 17, 2021 Author Share Posted February 17, 2021 does not work Link to comment Share on other sites More sharing options...
ComGrafPL Posted February 17, 2021 Share Posted February 17, 2021 11 hours ago, Aleksey19881988 said: does not work Send me your order-confirmation-table.tpl on private msg. I will see if its same. Link to comment Share on other sites More sharing options...
Aleksey19881988 Posted March 14, 2021 Author Share Posted March 14, 2021 ok, send Link to comment Share on other sites More sharing options...
lennynero Posted October 12, 2021 Share Posted October 12, 2021 Hello, Can you give us an answer in public please thank you Link to comment Share on other sites More sharing options...
V4ness4 Posted November 15, 2023 Share Posted November 15, 2023 Bonjour, Quelqu'un a t'il finalement trouvé la solution ? Je suis sur la version prestashop 1.7.8.7. Link to comment Share on other sites More sharing options...
Yulia Vitun Posted February 16, 2024 Share Posted February 16, 2024 On 11/15/2023 at 3:27 PM, V4ness4 said: Bonjour, Quelqu'un a t'il finalement trouvé la solution ? Je suis sur la version prestashop 1.7.8.7. I have solution, write to me Link to comment Share on other sites More sharing options...
Yulia Vitun Posted February 16, 2024 Share Posted February 16, 2024 // REQUIRED FIELDS "merchant_id": XXXXXXXXX, "order_id": "{/literal}{$smarty.get.id_order}{literal}", "email": "{/literal}{$customer.email}{literal}", "delivery_country": "BE", "estimated_delivery_date": "{/literal}{date('Y-m-d', $smarty.now+432000)}{literal}", Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now