Magento 2.4.2-p1
Smartwave Porto theme
extensions from Amasty
subscribed to a Review service from Shopper Approved
We have been subscribed to the service from Shopper Approved for a long time. This allows our customers to rate us by filling out surveys. I haven't updated the code on our website since upgrading from Magento 1 to Magento 2. I called them today and they said it would be best if I was able to replace 3 variables in the code we are meant to put on the Check-out Confirmation page with the actual variables for:
- Order Id
- Name
Where can I find these in Magento 2? Or if universal, what are they?
UPDATED on January 19th, 2022:
The JavaScript code we were given by Shopper Approved to enter in on the Checkout Confirmation page is this:
<script type="text/javascript"> var sa_values = { "site":12345, "token":"d138", 'orderid':'ORDER123', 'name':'John Doe', 'email':'[email protected]' }; function saLoadScript(src) { var js = window.document.createElement("script"); js.src = src; js.type = "text/javascript"; document.getElementsByTagName("head")[0].appendChild(js); } var d = new Date(); saLoadScript("https://www.shopperapproved.com/thankyou/rate/23891.js?d=" + d.getTime()); </script>
Would I put that in like this?
<script type="text/javascript"> var sa_values = { "site":12345, "token":"d138", '$orderId':'ORDER123', '$name':'John Doe', '$email':'[email protected]' }; function saLoadScript(src) { var js = window.document.createElement("script"); js.src = src; js.type = "text/javascript"; document.getElementsByTagName("head")[0].appendChild(js); } var d = new Date(); saLoadScript("https://www.shopperapproved.com/thankyou/rate/23891.js?d=" + d.getTime()); </script>
or this?
<script type="text/javascript"> var sa_values = { "site":12345, "token":"d138", 'orderid':'$orderId', 'name':'$name', 'email':'$email' }; function saLoadScript(src) { var js = window.document.createElement("script"); js.src = src; js.type = "text/javascript"; document.getElementsByTagName("head")[0].appendChild(js); } var d = new Date(); saLoadScript("https://www.shopperapproved.com/thankyou/rate/23891.js?d=" + d.getTime()); </script>