they release new feature on the 15.7
as i understand from here:
https://www.wix.com/corvid/reference/$w.ThankYouPage.html#getOrder
getOrder()
Gets the order associated with the current page.
Description:
The getOrder() function returns a Promise that is resolved when the information about the order associated with the ThankYouPage is retrieved.
when i’m using this code on the Thank You Page:
$w('#thankYouPage1').getOrder()
.then( (order) => {
let orderNumber = order.number;
let billingEmail = order.billingInfo.email;
// see example order object below
} )
i need to get this result for example:
/*
* Example order object:
*
* {
* "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
* "billingInfo": {
* "address": {
* "formatted": "235 W 23rd St, New York, NY 10011, USA",
* "city": "New York",
* "country": "USA",
* "addressLine": "235 W 23rd St",
* "postalCode": "10011"
*
and more...
but i get an error on my code


can someone try it and see if you get this error on the Element with getOrder()
its look like they forgot to upload version to the store thank you page
Thanks
Yes please I would like to see this resolved as well
Hi gali.levinshtein . Thank You Page API list will be updated soon and error will disappear. In any case getOrder() API works. Please let me know if it doesn’t work for you.
Thank you, I’m trying to use these order variables in my Google Customer Review popup - but for some reason it’s still not working - any thoughts?
// For full API documentation, including code examples, visit http://wix.to/94BuAAs
import wixData from 'wix-data';
var nextweek = new Date();
nextweek.setDate(nextweek.getDate()+14);
var orderNumber;
var deliveryCountry;
var billingEmail;
var gtin;
$w.onReady(function () {
$w('#thankYouPage1').getOrder()
.then( (order) => {
orderNumber = order.number;
billingEmail = order.billingInfo.email;
deliveryCountry = order.billingInfo.address.country;
gtin = order.lineItems[0].sku
// see example order object below
} )
.catch( (error) => {
console.log(error);
Then here is the Google Review pop-up
<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": 128349504,
"order_id": orderNumber,
"email": "support@levyelectric.com",
"delivery_country": "US",
"estimated_delivery_date": nextweek,
// OPTIONAL FIELDS
"products": [{"gtin":"722458802363"}]
});
});
};
</script>
Hi Eric Levenseller ,
you can check that order data shown in console if you add console.log(order) in the promise resolve. Looks like an issue is with the Google Review pop-up only. You can try https://www.wix.com/arena for help.
working Greate THANK YOU!