I
I
IgorBorys2020-12-30 12:14:14
Google
IgorBorys, 2020-12-30 12:14:14

How to get the order_id and email of the buyer in Bitrix?

After ordering the goods, a page pops up.
5fec41388c2c3932595667.jpeg

It is generated through the /personal/order/make/index.php file, which contains the bitrix:sale.order.ajax component. The bottom

line is that I can’t integrate Google reviews after the buyer’s order. There you need to display the order_id and email of the buyer.

<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": мой id,
          "order_id": "<b>ORDER_ID</b>",
          "email": "<b>CUSTOMER_EMAIL</b>",
          "delivery_country": "знаю",
          "estimated_delivery_date": "знаю",

          // OPTIONAL FIELDS
          "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}]
        });
    });
  }
</script>


I tried to display it on a separate page, which, according to the idea, should be loaded after the buyer pays for the goods, but I don’t understand how to check whether the script works there.

Really no one from Bitrix specialists has ever connected the code of sellers from Google?
https://support.google.com/merchants/answer/710624...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Sidorenko, 2020-01-02
@IgorBorys

Look at the confirm page (if the standard template) in the arResult array.
If not, then you always have an order ID by which you can get information

I
Il'ia Kartovitskii, 2020-12-30
@kartovitskii

You can save the fields you need in $_SESSION at the time of ordering And then get the values ​​​​from there on the page you need
$_SESSION['EMAIL'] = $email

D
darmoid, 2021-02-06
@darmoid

The code is being validated in Google Merchant , but for some reason the letters are not sent xs ..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question