Jump to content

How to install the Google Customer Reviews code PS 1.7


Aleksey19881988

Recommended Posts

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

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

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

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 by jacekgabor (see edit history)
Link to comment
Share on other sites

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

  • 4 weeks later...
  • 6 months later...
  • 2 years later...
  • 3 months later...

// 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

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...