The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 07-24-2011, 05:49 AM
Curtis Noble's Avatar
Curtis Noble 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 07-29-2012, 10:24 PM
Tigress Yoga's Avatar
Tigress Yoga Tigress Yoga is offline
Junior Member
 
Join Date: Dec 2011
Posts: 8
Default 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 View Post
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.
  #6  
Old 07-30-2012, 08:06 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 Susan Living1 View Post
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.
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
  #7  
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?
  #8  
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
  #9  
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.
  #10  
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
 
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 03:48 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.