$w(‘#thankYouPage1’).getOrder()

Once again I’m back with getOrder problems.
I know this sometimes returs 0 as a Order number, i dealt with that.

Now on my recent client’s website the getOrder() returns undefined.

I know usually this is a issue of asking for someone elses’ order details, but I’m refering to orders that I have created recently, being as fresh as a few minutes.

I’m stuck at this point.

Basically I am on the Thank you page of order that I have made a few seconds / minutes ago and my script produces “undefined”.

(And also my full code, which works on tens of WiX websites, fails here…)

$w('#thankYouPage1').getOrder()
  .then((order) => {
    console.log(order);
  })
  .catch((error) => {
    console.log(error);
  });

@ostryweb Hey! Moving this to the Ask a Question section to see if we can get an answer for you. Stay tuned!

Can you share the exact error message?

Also please confirm that:

  1. The id of the Thank You page is thankYouPage1
  2. This code is inside of the page’s $w.onReady() function

It is weird for getOrder() to be undefined here so want to make sure everything is covered.

1/ yes
2/ yes

it is weird indeed. there is no error message. just the console.log(order); writes “undefined”. that is it.

I also sent this as a support ticket, but after three mails they still do not understand what am I asking about (all the replies were about the rest of the code, which I do not discuss, because it never gets there and also this code works on other sites normally… there is no difference in the code and the difference in the behaviour is that this does not return the order object, but returns “undefined”.)

I am aware that this happens usually if I open thankyou page from different browser, meaning I do not have a access to the order data and I understand this. However, here all the orders where created by me on the same browser before…

Can you provide a code sample and steps to reproduce the issue?

steps:
I order something and on thank you page i see “undefined” in my console.

The code on the Thank You page:

$w.onReady(function () {
$w('#thankYouPage1').getOrder()
  .then((order) => {
    console.log(order);
  })
  .catch((error) => {
    console.log(error);
  });
});

In editor I can see the Thank you page content has ID of thankYouPage1.

Hello,
I have the exact same error since a few weeks. The getOrder returns undefined when deployed live while it works well in the editor.

Ok, so I have contacted WiX support on 9.11., they have been escalating the problem gradually, the last message is from 23.11. where the “technical team” was notified, I have no messages since…

Bad news is that another client/shop notified me today of a problem and the symptoms are the same. So up to yesterday everything was working ok, since then this happens also there.

I am using this on 33 shops and if this defect will affect all of them eventually, I will be forced to stop my service and they will be forced to stop using the most popular shipping service in my country… :skull_and_crossbones:

At this point the problem has been resolved, they informed me through the support ticket and I have tested it on the problematic sites (I found out since friday it was happening on at least 9 sites) and it is working properly now indeed, so I hope the problem will not come back. :pray:

1 Like