
07-24-2011, 05:49 AM
|
 |
Junior Member
|
|
Join Date: Mar 2011
Posts: 1
|
|
Redirect successful orders to a custom "thank you" page
How can I redirect successful orders after checkout to a custom "thank you" page back on my site? I'm using PayPal Website Payments Standard. I think. I have a paypal acct. but when I go to "try website payments standard" it just asks me to create a button...which I don't need because Ecwid provides the "checkout" or "pay" buttons for me.
I can see in the flow of creating a paypal button the option to redirect to a success page on my site. But is there a place to set this in Ecwid?
|

07-25-2011, 03:15 PM
|
 |
Paid Member
|
|
Join Date: Aug 2010
Posts: 141
|
|
Your client will return to your Ecwid shop after clicking the accept/continue in Paypal to view and confirm the order.
|

12-18-2011, 01:45 AM
|
 |
Paid Member
|
|
Join Date: Dec 2011
Posts: 4
|
|
Hi Helpful Souls!
I too would like to re-direct all successful orders through ecwid to a custom thank you page on my site.
I have set it up for paypal to do this already so that's fine.
I would like to be able to redirect orders through credit card (not paypal) to a custom page also.
Please help and thank you!
|

12-20-2011, 11:01 AM
|
 |
Ecwid Team
|
|
Join Date: Oct 2011
Posts: 3,299
|
|
Quote:
Originally Posted by Susan Living1
Hi Helpful Souls!
I too would like to re-direct all successful orders through ecwid to a custom thank you page on my site.
I have set it up for paypal to do this already so that's fine.
I would like to be able to redirect orders through credit card (not paypal) to a custom page also.
Please help and thank you!

|
Hello,
In order to redirect your customers from the order confirmation page to a custom one, you should use a special JavaScript code which will use the Ecwid Javascript API for handling the Ecwid 'OnPageLoad' event. The code looks like this:
Code:
<script>
var confirmationPageURL = "http://google.com";
// Add handler for Ecwid's OnPageLoad event
if (
typeof(Ecwid) == 'object'
&& typeof(Ecwid.OnPageLoad) == 'object'
) {
Ecwid.OnPageLoad.add(function(page) {
// Redirect user if needed
if (
typeof(page) == 'object'
&& 'ORDER_CONFIRMATION' == page.type
) {
window.location = confirmationPageURL;
}
});
}
</script>
The line ' window.location = confirmationPageURL' will be executed (a visitor will be redirected) right after the confirmation page page is loaded. As you can see, a custom page URL is stored in the variable ' confirmationPageURL' (it is set as 'http://google.com' in the beginning of the code). Please put your 'thank you' page's address in there.
Please notice, that the code above should be inserted after the Ecwid integration code on the page where your store is installed.
Last edited by Makfruit; 12-29-2011 at 04:44 AM.
|

07-29-2012, 10:24 PM
|
 |
Paid Member
|
|
Join Date: Dec 2011
Posts: 4
|
|
Where do I put the code in my wordpress site?
Hi Makfruit,
Thank you so much for your detailed reply.
I know very little about coding
Where do I put the code below? I understand I need to put it on the same page that has the ecwid shopping cart now.
Do I put in after that html in the page editor?
I'm using Wordpress
Thank you!
Quote:
Originally Posted by Makfruit
Hello,
In order to redirect your customers from the order confirmation page to a custom one, you should use a special JavaScript code which will use the Ecwid Javascript API for handling the Ecwid 'OnPageLoad' event. The code looks like this:
Code:
<script>
var confirmationPageURL = "http://google.com";
// Add handler for Ecwid's OnPageLoad event
if (
typeof(Ecwid) == 'object'
&& typeof(Ecwid.OnPageLoad) == 'object'
) {
Ecwid.OnPageLoad.add(function(page) {
// Redirect user if needed
if (
typeof(page) == 'object'
&& 'ORDER_CONFIRMATION' == page.type
) {
window.location = confirmationPageURL;
}
});
}
</script>
The line ' window.location = confirmationPageURL' will be executed (a visitor will be redirected) right after the confirmation page page is loaded. As you can see, a custom page URL is stored in the variable ' confirmationPageURL' (it is set as 'http://google.com' in the beginning of the code). Please put your 'thank you' page's address in there.
Please notice, that the code above should be inserted after the Ecwid integration code on the page where your store is installed.
|
|

07-30-2012, 08:06 AM
|
 |
Ecwid Team
|
|
Join Date: Oct 2011
Posts: 3,299
|
|
Quote:
Originally Posted by Susan Living1
Hi Makfruit,
Thank you so much for your detailed reply.
I know very little about coding
Where do I put the code below? I understand I need to put it on the same page that has the ecwid shopping cart now.
Do I put in after that html in the page editor?
I'm using Wordpress
Thank you!
|
Hi,
The code of a JS modification like the one discussed here should be placed in the HTML code of Wordpress page where your Ecwid store is installed. If you embed Ecwid manually by copying and pasting the code from the Dashboard page of your control panel to your store page, then the JS code needs to be inserted likewise into the HTML source code of that same page (after the Ecwid integration code). On the other hand, if you use our ready Wordpress plugin, it creates a special page for the store. In your WP Admin → Pages it can be usually found as a page entitled 'Store'. You need to go editing the store page, switch your editor to HTML mode (a gray tab on the top right of editable area) and paste the code in there (again, after the Ecwid integration code). Then you need to apply the changes by pressing Update button on the right column.
|

12-29-2011, 12:34 AM
|
 |
Paid Member
|
|
Join Date: Oct 2011
Posts: 2
|
|
I have tried to do this, but when I insert the code after the Ecwid Integration code, it appears on my shopping cart. Am I inserting it in the wrong place?
Also note, I had the shopping cart designed by Ecwid Integration Service...is there a different place to put this code?
|

12-29-2011, 05:24 AM
|
 |
Ecwid Team
|
|
Join Date: Oct 2011
Posts: 3,299
|
|
Quote:
Originally Posted by Dre Slaman
I have tried to do this, but when I insert the code after the Ecwid Integration code, it appears on my shopping cart. Am I inserting it in the wrong place?
Also note, I had the shopping cart designed by Ecwid Integration Service...is there a different place to put this code?
|
Hi,
The issue is caused by the missing '<script> ... </script>' tags in the code. When you add some javascript code to an HTML page, that code should be wrapped with 'script' tags for being executed, otherwise it will be displayed as plain text.
I have edited the code in my previous post in this thread according to this rule. Please insert the changed code after the Ecwid integration code on the page where your store is installed. It will work.
If the issue is not resolved, please let us know.
|

12-29-2011, 04:23 PM
|
 |
Paid Member
|
|
Join Date: Oct 2011
Posts: 2
|
|
Hello,
The script is gone - thank you. But the customers are being redirected to my home page instead of the "thank you" page. I have tested the url that I inserted into the "var confirmationPageURL = "http://google.com";" section by copy and pasting it into my web browser and the URL works fine on its own. Any help would be greatly appreciated.
|

01-05-2012, 11:19 AM
|
 |
Ecwid Team
|
|
Join Date: Oct 2011
Posts: 3,299
|
|
Quote:
Originally Posted by Dre Slaman
Hello,
The script is gone - thank you. But the customers are being redirected to my home page instead of the "thank you" page. I have tested the url that I inserted into the "var confirmationPageURL = "http://google.com";" section by copy and pasting it into my web browser and the URL works fine on its own. Any help would be greatly appreciated.
|
I have inspected your site. The reason of the issue is your Ecwid store is displayed in a frame on the store page. The custom script discussed in this thread is placed in that frame too, thus it cannot redirect a visitor by changing a 'window.location' variable. In order to fix it you should use the 'window.top.location.href' property instead. Please replace this line in your code:
Code:
window.location = confirmationPageURL;
with this one:
Code:
window.top.location.href = confirmationPageURL;
Hope it helps.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 03:34 AM.
Powered by vBulletin® Version 3.8.6. Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
|