Answer the question
In order to leave comments, you need to log in
How to get the order_id and email of the buyer in Bitrix?
After ordering the goods, a page pops up.
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>
Answer the question
In order to leave comments, you need to log in
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
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question