The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
Closed Thread
 
Thread Tools Display Modes
  #1  
Old 07-24-2011, 05:49 AM
Curtis Noble's Avatar
Curtis Noble is offline
Junior Member
 
Join Date: Mar 2011
Posts: 1
Default

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?
  #2  
Old 07-25-2011, 03:15 PM
WoodYouLike's Avatar
WoodYouLike WoodYouLike is offline
 
Join Date: Aug 2010
Posts: 593
Default

Your client will return to your Ecwid shop after clicking the accept/continue in Paypal to view and confirm the order.
__________________
Owner/manager of [URL="http://www.woodyoulike.co.uk"]Wood You Like Ltd[/URL], independent retailer of quality wooden flooring in rural Kent UK
Creator of E-guide "[URL="http://blog.1plus1makes3.co.uk/selling-online.html"]Selling Online Basics[/URL]" :ecwid:
  #3  
Old 12-18-2011, 02:45 AM
Tigress Yoga's Avatar
Tigress Yoga Tigress Yoga is offline
Junior Member
 
Join Date: Dec 2011
Posts: 8
Default

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!

  #4  
Old 12-20-2011, 12:01 PM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,947
Default

Quote:
Originally Posted by Susan Living1 View Post
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.
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials

Last edited by Makfruit; 12-29-2011 at 05:44 AM.
The Following User Says Thank You to Matt Ecwid For This Useful Post:
Rick G (08-17-2015)
  #5  
Old 12-29-2011, 01:34 AM
Dre Slaman's Avatar
Dre Slaman Dre Slaman is offline
 
Join Date: Oct 2011
Posts: 2
Default

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?
  #6  
Old 12-29-2011, 06:24 AM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,947
Default

Quote:
Originally Posted by Dre Slaman View Post
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.
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
  #7  
Old 12-29-2011, 05:23 PM
Dre Slaman's Avatar
Dre Slaman Dre Slaman is offline
 
Join Date: Oct 2011
Posts: 2
Default

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.
  #8  
Old 01-05-2012, 12:19 PM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,947
Default

Quote:
Originally Posted by Dre Slaman View Post
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.
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
  #9  
Old 04-09-2012, 06:26 PM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

I used the code above and followed the instructions, but my URL redirect doesn't redirect. It takes the user nowhere.

Here is my code. Not sure what steps I'm missing here...figured it was pretty straight forward:

Quote:
<div>
<script type="text/javascript" src="http://app.ecwid.com/script.js?1133170" charset="utf-8"></script>
<script type="text/javascript"> xProductBrowser("categoriesPerRow=3","views=grid(3 ,3) list(10) table(20)","categoryView=grid","searchView=list"," style="); </script>
<noscript>Your browser does not support JavaScript. Please proceed to <a href="http://app.ecwid.com/jsp/1133170/catalog">HTML version of Steve Strickland's store</a></noscript>
</div>
<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>
  #10  
Old 04-09-2012, 08:08 PM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,947
Default

Quote:
Originally Posted by Steve Strickland1 View Post
I used the code above and followed the instructions, but my URL redirect doesn't redirect. It takes the user nowhere.

Here is my code. Not sure what steps I'm missing here...figured it was pretty straight forward:
Hi,

Could you provide a URL of your store page? We'll look into it.
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
Closed Thread
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
checkout, paypal

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:02 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.