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
  #11  
Old 04-09-2012, 08:15 PM
Steve Strickland1's Avatar
Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default


Hi Makfruit,

Thank you for the reply. Here is the URL: http://chezchamar.com/?page_id=52

Looking forward to your reply.

Thanks

Steve
  #12  
Old 04-10-2012, 04:11 AM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

Here is the URL

http://chezchamar.com/?page_id=52

Thank you
  #13  
Old 04-10-2012, 10:05 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 Steve Strickland1 View Post
Hi Makfruit,

Thank you for the reply. Here is the URL: http://chezchamar.com/?page_id=52

Looking forward to your reply.

Thanks

Steve
Thank you. I've inspected your site. As far as I can see, the javascript code you've added is corrupted by Wordpress editor you used to enter it.

Now the code looks as follows:
Code:
<script>
var confirmationPageURL = "http://google.com";</p>
<p>// Add handler for Ecwid's OnPageLoad event
if (
  typeof(Ecwid) == 'object'
  #038;#038; typeof(Ecwid.OnPageLoad) == 'object'
) {
  Ecwid.OnPageLoad.add(function(page) {
    // Redirect user if needed
    if (
      typeof(page) == 'object'
      #038;#038; 'ORDER_CONFIRMATION' == page.type
    ) {
      window.location = confirmationPageURL;
    }
  });
}
</script>
I've marked errors with red. Most likely, the text editor you used added those corrections. Please try to re-enter the code, using this instructions:
1) Toggle page/post editor in HTML mode (WYSIWYG mode doesn't allow javascript codes)
2) Enter the code
3) Save it (without returning to WYSIWYG mode).
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
  #14  
Old 04-10-2012, 05:40 PM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

Quote:
Originally Posted by Makfruit View Post
Thank you. I've inspected your site. As far as I can see, the javascript code you've added is corrupted by Wordpress editor you used to enter it.

Now the code looks as follows:
Code:
<script>
var confirmationPageURL = "http://google.com";</p>
<p>// Add handler for Ecwid's OnPageLoad event
if (
  typeof(Ecwid) == 'object'
  #038;#038; typeof(Ecwid.OnPageLoad) == 'object'
) {
  Ecwid.OnPageLoad.add(function(page) {
    // Redirect user if needed
    if (
      typeof(page) == 'object'
      #038;#038; 'ORDER_CONFIRMATION' == page.type
    ) {
      window.location = confirmationPageURL;
    }
  });
}
</script>
I've marked errors with red. Most likely, the text editor you used added those corrections. Please try to re-enter the code, using this instructions:
1) Toggle page/post editor in HTML mode (WYSIWYG mode doesn't allow javascript codes)
2) Enter the code
3) Save it (without returning to WYSIWYG mode).
Hi Makfruit,

Thanks for the help. I did update my page and have removed the information you mentioned. However, the redirect still does not work. I can complete an order successfully, but after that, nothing happens. You can submit orders if you want. It's in demo mode so nothing actually is charged (I just get email notifications). What else do you think could be causing it?

Thanks again,

Steve
  #15  
Old 04-10-2012, 05:46 PM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

Actually, I keep seeing extra code inserted everytime I update my page - and this is even doing it from an HTML box and not the WYSIWYG or html tab on the page in WordPress.
  #16  
Old 04-10-2012, 06:33 PM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

No matter what I try, it keeps inserting extra code: (espcially the "<![CDATA[")

Quote:
<script>// <![CDATA[
var confirmationPageURL = "http://google.com";</p>
<p>// 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;
}
});
}
// ]]&gt;</script></p>
  #17  
Old 04-10-2012, 06:47 PM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

Should I be adding some script to my php header file for this template I'm using in Wordpress? Seems like I need to make some javascript call so it stops inserting the <p> and </p>.
  #18  
Old 04-10-2012, 06:56 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
Actually, I keep seeing extra code inserted everytime I update my page - and this is even doing it from an HTML box and not the WYSIWYG or html tab on the page in WordPress.
Well, it often happens that CMS text editors treat JS codes as an HTML and format them accordingly, so, as a result, they don't work. But there is a workaround. Please refer to the second part of this article:
http://kb.ecwid.com/w/page/48172585/...xternal%20site

It recommends to place custom JS scripts in a separate js file (or files) and call it from the page code. Moreover, such way gives another advantage - you can use the same external file in different places instead of pasting the same code into the pages one be one.

Please let me know if you have any question.
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
  #19  
Old 04-10-2012, 07:22 PM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

Quote:
Originally Posted by Makfruit View Post
Well, it often happens that CMS text editors treat JS codes as an HTML and format them accordingly, so, as a result, they don't work. But there is a workaround. Please refer to the second part of this article:
http://kb.ecwid.com/w/page/48172585/...xternal%20site

It recommends to place custom JS scripts in a separate js file (or files) and call it from the page code. Moreover, such way gives another advantage - you can use the same external file in different places instead of pasting the same code into the pages one be one.

Please let me know if you have any question.
I put the script inside a JS file and I'm now making a call to the file using:
<script type="text/javascript" language="javascript" src="/wp-includes/redirect.js"></script>

However, those pesky <p> and </p> come back...
  #20  
Old 04-10-2012, 07:40 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 put the script inside a JS file and I'm now making a call to the file using:
<script type="text/javascript" language="javascript" src="/wp-includes/redirect.js"></script>
The path you set for the script ("/wp-includes/redirect.js") points to this address:
http://chezchamar.com/wp-includes/redirect.js

But there is no script file there - try to open that URL, an empty page is returned. You should place the script in a publicly accessible place so that the store page would be able to get it - in this case the script will work.


Quote:
However, those pesky <p> and </p> come back...
Don't worry, it's OK now. They are placed outside the script inclusion:
Code:
<p><script type="text/javascript" language="javascript" src="/wp-includes/redirect.js"></script></p>
This way they don't break anything.
__________________
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 12:45 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.