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
  #21  
Old 04-11-2012, 03:48 AM
Steve Strickland1's Avatar
Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default


Quote:
Originally Posted by Makfruit View Post
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.




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.

So, instead of using the .js file and making a call to it, I just used the regular script code, but I'm using a "raw html" plugin that is stripping out any formatting Wordpress is injecting in there. The redirection now actually works.

So, two questions now.

1. How can I control the speed of the redirection. When I test now, it's instant! Can I slow it down somehow...like after 3-5 seconds?

2. How I protect my source code or the javascript from prying eyes? I don't want people to be able to just go see my source code, see where they are redirected and just grab the URL and bypass the whole shopping cart.

Thank you

Last edited by Steve Strickland1; 04-11-2012 at 03:52 AM.
  #22  
Old 04-12-2012, 09:58 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
1. How can I control the speed of the redirection. When I test now, it's instant! Can I slow it down somehow...like after 3-5 seconds?
By means of special functions in javascript, you can delay script execution. For example, the 'setTimeout' function can be used for such purposes.


Quote:
2. How I protect my source code or the javascript from prying eyes? I don't want people to be able to just go see my source code, see where they are redirected and just grab the URL and bypass the whole shopping cart.
Frankly speaking, I am not sure why you want to do this. Who is going to see the source codes and why? You don't put any sensitive data in them, do you? As for bypassing the shopping cart, it isn't clear either. Could you possibly explain why you need it?

The thing is Javascript, CSS and HTML codes are processed on the client side (by browser). In order to parse HTML and CSS and execute Javascript, a browser has to download them all to an user's computer. It means that, technically, anyone who wants to see the sources will be able to do it.

As far as I know, the only way to protect your javascript code a little is making the source codes themselves not human-readable. It can be done by means of obfuscation of your code. Browsers will be able to parse and execute it as usual, but it will be a bit difficult for a human to read it. But even so, anyone will be able to see it.

If you need a professional help with custom modifications, I suggest you to contact our colleagues from Qualiteam: sales@qtmsoft.com . They will be glad to help.
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
The Following User Says Thank You to Matt Ecwid For This Useful Post:
Steve Strickland1 (04-12-2012)
  #23  
Old 04-12-2012, 10:36 PM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

Thank you again for all your help. I actually did decide (after reading your post), there's no need for me to hide the link. For what I'm trying to achieve, the end-user will still be sent a username/password to access a portion of the site to get to a protected area. And if someone bypasses it, I'll know, because I would never have received an email about a credit card charge.

I'm kind of talking a very long, and educational route for a user wanting on-demand computer support - whereas I route them through the shopping cart, make the charge, I'm notified, then they are taken to a page with a special link that will allow them to connect to me (or software I have running on my end) and we establish a remote desktop sharing session and I can fix their computer.

One last question. The receipt sent to the user after they are charged - can that be modified with some additional text I'd like to include in the receipt - or should I start a new thread and/or search around?

Thanks again. You've been a great help w/this javascript stuff.
  #24  
Old 04-14-2012, 04:09 AM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

Hi Makfruit,

Perhaps you can help me w/this code. My timeout isn't working.

<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;
window.setTimeout(confirmationPageURL, 8000, true);
}
});
}

</script>

As you mentioned in your previous post, I could use the window.setTimeout....and I am, but it's not working - and it's probably my fault for incorrect usage, since I know nothing about JavaScript. Do you know why it's not delaying for 8 seconds, but rather just does the redirect instantly?

Thank you again.
  #25  
Old 04-16-2012, 08:59 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
One last question. The receipt sent to the user after they are charged - can that be modified with some additional text I'd like to include in the receipt - or should I start a new thread and/or search around?
Please refer to this thread:
http://www.ecwid.com/forums/showthread.php?p=48330


Quote:
As you mentioned in your previous post, I could use the window.setTimeout....and I am, but it's not working - and it's probably my fault for incorrect usage, since I know nothing about JavaScript. Do you know why it's not delaying for 8 seconds, but rather just does the redirect instantly?
The 'setTimeOut' function takes another function as a parameter so that the latter executes after specified timeout. Thus you will need to put your redirection code into a new function and put it as a parameter for the setTimeOut. Please refer to this document for the details:
https://developer.mozilla.org/en/DOM/window.setTimeout

If you need an assistance with this or want someone to develop the modification for you, please contact our friends from Qualiteam: sales@qtmsoft.com .
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
The Following User Says Thank You to Matt Ecwid For This Useful Post:
Steve Strickland1 (04-16-2012)
  #26  
Old 04-16-2012, 04:25 PM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

Thanks again Makfruit.

I was finally able to figure it out and if everyone wants the code, here it is:

Quote:
<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
) {
doit = function() {window.location = confirmationPageURL;}
window.setTimeout(doit, 8000, true);
}
});
}
</script>
(replace www.google.com with whatever URL you want the user to be redirected to after they place their order). (change the 8000 to whatever # want in milliseconds).
The Following 2 Users Say Thank You to Steve Strickland1 For This Useful Post:
Doc (04-17-2012), Matt Ecwid (04-16-2012)
  #27  
Old 05-30-2012, 05:23 PM
NTM Design Group's Avatar
NTM Design Group NTM Design Group is offline
Junior Member
 
Join Date: May 2012
Posts: 3
Default

Hello - I followed the above and was able to redirect my store upon completion - however I am using in Snappages and it takes me to a site within my site.....so it actually shows my websites condensed within the window of the store - all within my main site....so it isn't really redirecting the page on my actual website. Can you help?
Thank you
  #28  
Old 05-30-2012, 05:26 PM
NTM Design Group's Avatar
NTM Design Group NTM Design Group is offline
Junior Member
 
Join Date: May 2012
Posts: 3
Default

Hello - I followed the above and was able to redirect my store upon completion - however I am using in Snappages and it takes me to a site within my site.....so it actually shows my websites condensed within the window of the store - all within my main site....so it isn't really redirecting the page on my actual website. Can you help?
Thank you
  #29  
Old 05-30-2012, 05:28 PM
Steve Strickland1's Avatar
Steve Strickland1 Steve Strickland1 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 13
Default

Quote:
Originally Posted by NTM Design Group View Post
Hello - I followed the above and was able to redirect my store upon completion - however I am using in Snappages and it takes me to a site within my site.....so it actually shows my websites condensed within the window of the store - all within my main site....so it isn't really redirecting the page on my actual website. Can you help?
Thank you
I might say contact Snappages. It looks like they host your actual website and control the backend - and they might have limitations on javascript. I was using the code in Wordpress where I have access to everything. I had no issues at all. I've never used Snappages either....sorry can't be much help.
  #30  
Old 05-30-2012, 05:46 PM
NTM Design Group's Avatar
NTM Design Group NTM Design Group is offline
Junior Member
 
Join Date: May 2012
Posts: 3
Default

Thanks Steve - here is the weird thing - I took the code out to wait to see what response came - and just ran a test - and now it is redirecting just as I want it to.....not sure how that worked - but seems to have worked out!!
Thanks for your help!
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 07:19 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.