ssl fix - multiple servers/domains fix

Completed modifications to the NOP Shopping Cart. Additions, modifications, and more.

Moderators: Koibito, Stefko, Randy, Rosey

ssl fix - multiple servers/domains fix

Postby Jared » Fri Jun 13, 2003 9:33 pm

Hello NOP JavaScript Shopping Cart users. I have written a class to deal with the problem of having a shopping cart on one domain and the checkout on another domain.

The problem is that the cookies can only be read by the domain that created them, so when you hit your checkout.html file you can not read the cookie if you are switching domains in the process.

The solution is to not rely on the cookie. If you notice, the variables you need are passed along via a GET method of the managecart.html. So what I have done is port the CheckoutCart() function from the nopcart.js file over to php :D .

Copy the code below and save it as a plain text file with a file extension of php. Read the usage comments located in the top of the code.
I have tried to maintain the payments options, but have not tested them. I wrote this for a client that processes their own credit cards, so I use another script I wrote and posted called MyCheckout to store the information in a MySQL database.

Hope this helps someone else out with the problem I had. Good luck and Aloha.

*** EDIT 01.30.05 ***

I have rewritten the solution from PHP to JavaScript. You can grab a copy here:

http://www.jaredeckersley.com/free.html
Attachments
ssl_fix.class.txt
ssl fix - multiple servers/domains fix
(8.99 KiB) Downloaded 288 times
Last edited by Jared on Mon Jan 31, 2005 4:23 am, edited 2 times in total.
- Jared Eckersley
- http://www.jaredeckersley.com
Jared
 
Posts: 25
Joined: Thu Jun 12, 2003 8:18 am

help with ssl fix

Postby Jared » Fri Jun 13, 2003 9:54 pm

Please post all questions regarding this fix to this thread. I don't mind helping others, but it would help if all problems/solutions were made public for others to gain from.
Attachments
ssl_fix.class.txt
ssl_fix.class.txt
(8.99 KiB) Downloaded 423 times
Last edited by Jared on Mon Dec 27, 2004 7:39 am, edited 1 time in total.
- Jared Eckersley
- http://www.jaredeckersley.com
Jared
 
Posts: 25
Joined: Thu Jun 12, 2003 8:18 am

Can't get it to work

Postby nels » Tue Oct 07, 2003 3:00 am

I am having trouble with this, I was unsure where to put the ssl_fix.class.php in my structure I put a copy in main directory and also in cgi-bin I got errors unable to find stream, etc I have attached the sreen print for fun. I edited the instructions and took out the "../" prior to ssl_fix.class.php and the page loads but I am missing my data, the data is missing in both going to the SSL and staying withing my domain. I am sure it is something simple but I know little about php.

Any help is appreciated

web site is http://www.motor-reflections.com start your order in "Order Here"

Thanks
nels
 
Posts: 28
Joined: Fri Oct 03, 2003 5:32 pm
Location: ohio

lost the attachement

Postby nels » Tue Oct 07, 2003 3:29 am

sorry about that
nels
 
Posts: 28
Joined: Fri Oct 03, 2003 5:32 pm
Location: ohio

SSL Help

Postby Jared » Tue Oct 07, 2003 5:43 am

You can place the ssl_fix.class.php file anywhere, but you have to be able to point to it for inclusion. WHat this means is, in my instruction I say to add
<?php
include("../ssl_fix.class.php");
$ssl_fix = new ssl_fix();
$ssl_fix->drawCart();
?>
to your file, the line
include("../ssl_fix.class.php");
is the important line. If you want to place the ssl_fix.class.php file in the same dir/folder change the include statement to this:
include("ssl_fix.class.php");
That should do it. I also took a look at the link you posted and notice that the page you are sending your results to has a large portion of the code blocked out ... not sure if you meant to do that ...
Also, I did not look much further, but it appears that the only variables that you are passing are your quantity and tax variables. Your URL string on the checkout.php page reads like this:
checkout.php?Q=1&TAX=0.00&IMAGE.x=260&IMAGE.y=36
it should read something like this:
Q=1&ID_1=MR-1&QUANTITY_1=1&PRICE_1=300.00&NAME_1=Motor-Reflection&SHIPPING_1=0.00&ADDTLINFO_1=&SUBTOTAL=%306.00&SHIPPING=%0.00&TAX=%6.00&TOTAL=%306.00
I am not sure why your variables are not being passed, but that has to do with the setup of the cart.

Hope that helps.

- Jared Eckersley
- Jared Eckersley
- http://www.jaredeckersley.com
Jared
 
Posts: 25
Joined: Thu Jun 12, 2003 8:18 am

still not working for me

Postby nels » Tue Oct 07, 2003 4:18 pm

my carts seems to work fine when I use java script in a single domain my detail is all there. When I try the php fix in the secure domain the detail is missing.

If I preview the php form in dream weaver teh area for the box shows drawCart(); ?> is this correct?

I have my java version on the site now

HELP

Nels
http://www.motor-reflections.com
nels
 
Posts: 28
Joined: Fri Oct 03, 2003 5:32 pm
Location: ohio

problem solved, my fault

Postby nels » Tue Oct 07, 2003 5:31 pm

I had set the flag in nopcart.js to not pass hidden values when I was try a cgi checkout process and missed setting it back.


Thanks for all the help
:D :D
Nels
nels
 
Posts: 28
Joined: Fri Oct 03, 2003 5:32 pm
Location: ohio

now I want coupons and that is using non-php checkout

Postby nels » Wed Oct 22, 2003 8:36 pm

Can the fix_ssl be converted to run in a non-php world? I want to use the Webrecka mod for coupons as it seems very cool but use a shared SSL and this fix seems to be the answer to that problem.

I don't know enough about this code stuff to have any idea how to re-write this myself. :shock:

Thanks
Nels
http://www.motor-reflections.com
nels
 
Posts: 28
Joined: Fri Oct 03, 2003 5:32 pm
Location: ohio

will it work?

Postby Jared » Thu Oct 23, 2003 11:49 pm

I am not sure if it will work or not. One way is to test it out and see. I am not familiar with any other mods. As long as the coupon mod does not add any new variables to the mix, this should work without any fuss.

- Jared Eckersley
- Jared Eckersley
- http://www.jaredeckersley.com
Jared
 
Posts: 25
Joined: Thu Jun 12, 2003 8:18 am

new issue always tax

Postby nels » Mon Nov 10, 2003 2:21 am

I am confused, I thought I had this working for me but now I find all customers are being charged tax no matter the button they choose. Can someone (Jared :D ) look at these url bars and perhaps provide some insight. It may be caused by my certificate not being quite right... But I don't know enough to tell.

I think I might have caused the problem by adding a user enterable field to the order process. Any help or clues will be appreciated

my site is motor-reflections.com I see the tax field twice in the URL bar when I move into checkout.php

Here is the url bar in both states

In state should be charged tax
https://www.oursecureserver.us/~motorr/ ... IMAGE.y=27


Out of state should be no tax
https://www.oursecureserver.us/~motorr/ ... G=%240.00&TAX=%2442.00&TOTAL=%24642.00&IMAGE.x=261&IMAGE.y=13


Thanks
nels
 
Posts: 28
Joined: Fri Oct 03, 2003 5:32 pm
Location: ohio

TAX

Postby Jared » Thu Nov 13, 2003 3:37 pm

Did you get it working?
- Jared Eckersley
- http://www.jaredeckersley.com
Jared
 
Posts: 25
Joined: Thu Jun 12, 2003 8:18 am

Still charging tax all the time

Postby nels » Mon Nov 17, 2003 2:58 am

I have held off trying to solve this until my isp got the SSL issues solved. I was getting a certificate warning and thought that might be a factor. It is finally fixed today and I will try to find time this week to experiment. I did not get any response from echolon so I will most likely start from scratch and reapply mods until I track it down. I just don't know enough about how the data gets written to the URL bar (cookies I think).

I saw your test order, thanks for looking at us.
nels
 
Posts: 28
Joined: Fri Oct 03, 2003 5:32 pm
Location: ohio

drawCart(); ?>

Postby CBS » Thu Nov 20, 2003 8:38 pm

Alright,

One more time,

I followed the mod instruct,
what happened.

drawCart(); ?>
Always bear in mind that your own resolution
to success is more important than any one thing
CBS
 
Posts: 7
Joined: Thu Nov 20, 2003 8:33 pm
Location: Tampa Florida USA

help request

Postby Jared » Thu Feb 19, 2004 12:18 am

Please post requests for help here. I do not mind helping people figure out how to get the fix working, but all questions/solutions need to be preserved to help others who might experience a similiar problem.

- Jared Eckersley
- Jared Eckersley
- http://www.jaredeckersley.com
Jared
 
Posts: 25
Joined: Thu Jun 12, 2003 8:18 am

Won't work with linkpoint

Postby tmdelia » Sat Feb 21, 2004 1:56 pm

Unless there is a way to call a static page from managecart.html to checkout.php, this fix will never work with Linpoint.

Linkpoint requires that your checkout page is static and since the method used to send data from managecart.html to checkout.php adds strings of information to the url checkout.php, (i.e. checkout.phpQ+1etc., etc.) and those strings are always different.

Is there a way around this? You can't call the checkout page as far as I can tell by an method other than sending a form from managecart.html to checkout.php.

I've racked my brain and can't think of a solution. Any bright ideas?
tmdelia
 
Posts: 6
Joined: Thu Feb 19, 2004 1:15 am

Next

Return to Modifications

Who is online

Users browsing this forum: No registered users and 1 guest

cron