PDA

View Full Version : USPS shipping module


dstwcolr
7-7-05, 09:44 PM
does anyone else have their site merging with USPS to do the shipping calculations?

I have set it up got cofirmation e-mail that the test was right so I set it to production but when I try and go through the check out process it doesn't pull the shipping and then the check out process hangs there. Here is a link to the site in question. http://www.pieceful-dreams.com Does anyone have any suggestions? Or do you think this is on USPS end and not OSCommerce??

Thanks in advance, :)
Tina Richter
Jewelry Designer and owner of Links and Loops
http://www.linksandloops.com

stevel
7-7-05, 09:53 PM
Yes, my store uses USPS. Did you notify USPS that you wanted to be switched to the production server? I just tried my store and had no problems with the shipping calculation.

I tried your store - first thing I noticed was that you have HTTPS_SERVER set to https://www.pieceful-dreams.com. This will cause some browsers to complain because the domain on the certificate (*.secure.powweb.com) doesn't match yours. I recommend that you use https://pieceful-dreamscom.secure.powweb.com.

Did you set your store zip code properly in the osC admin? This is the other thing that can cause problems.

dstwcolr
7-7-05, 10:03 PM
Yes, my store uses USPS. Did you notify USPS that you wanted to be switched to the production server? I just tried my store and had no problems with the shipping calculation.

Yes I got the confirmation from USPS to go to production. so did that switch in teh module.

I tried your store - first thing I noticed was that you have HTTPS_SERVER set to https://www.pieceful-dreams.com. This will cause some browsers to complain because the domain on the certificate (*.secure.powweb.com) doesn't match yours. I recommend that you use https://pieceful-dreamscom.secure.powweb.com.

yes I knew this just have made the change yet.

Did you set your store zip code properly in the osC admin? This is the other thing that can cause problems.

I will double check this but I am 99.99999% it is correct. LOL
Thanks for your quick response Steve but you are always great for that. I always know I can count on you for answers. Your AWESOME GUY!!!

stevel
7-8-05, 10:03 AM
Well, if the above doesn't help, add some debugging code to usps.php to write out the status returned from the USPS web site and see if you can figure out the problem.

dstwcolr
7-12-05, 01:53 PM
Ok Steve I went into teh cinfigure.php and changed the SSL line but it still doesn't seem to be working the cert thingy still pops up. is there some where esle I was suposed to change the link other than catalog/admin/configure.php ??

Still trying to figure this shipping issue out as well.

Tina

stevel
7-12-05, 02:39 PM
There are two configure.php files, one for the catalog, and one for admin. They both have defines that need to be changed - you did not change the one in catalog/includes/ - it still is using your domain name in HTTPS_SERVER.

Be aware that these two files are NOT identical - they have similarities, but are not interchangeable. Don't make the common mistake of saving one file in both places.

dstwcolr
7-18-05, 01:50 PM
AAAAAAA! ok I changed it then I got an error on line 19 which was the cookies I put in the /catalog/ like I Have on my other shopping cart now I am getting this error message

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /www/p/piecefuldrea/htdocs/catalog/includes/functions/database.php on line 19
Unable to connect to database server!

stevel
7-18-05, 02:48 PM
Sounds as if you have not correctly set the database server name and other info in the configure.php files. Check for missing or extra apostrophes elsewhere in the file which can throw things off.

dstwcolr
7-18-05, 03:05 PM
ok now I am really confuesd. I fixed the errors but now look at my cart. what on earth did I do? LOL
http://pieceful-dreams.com/catalog/

dstwcolr
7-18-05, 03:11 PM
I figured it out

no I just have to go back and fix that one code to get rid of error at top of page. Then I will check the USPS thingy again and see if it works wish me luck

dstwcolr
7-18-05, 03:19 PM
ok this is just freaky, it is allowing me to log into the cart as a custmer but it is not holding my log in as soon as I go tto the checkout process it wants me to log in again and then it goes back to main page saying welcome guest. This is wierd.

dstwcolr
7-18-05, 03:27 PM
OK Steve pick your brain time LOL. I was finally able to log in and stay logged in this time maybe it was just a burp in the system. Well anyway.......

I am still getting the USPS error message when I try and check out. You had mentioned earlier about adding some debugging code to usps.php what is this and how do I do that?

moonbeam
7-18-05, 04:14 PM
You have bigger problems than just the USPS module. I tried to run a test order for you, as Billy Tester. Nothing stays in my cart even after I signed in. It keeps telling me my cart Is empty. I never made it to checkout to check the USPS module...
Sorry,
Moon

stevel
7-18-05, 06:09 PM
Post the first 20 lines of your catalog/includes/configure.php Don't include the database defines. Let's see where you're going wrong there.

dstwcolr
7-18-05, 07:17 PM
<?php
/*
$Id: configure.php,v 1.14 2003/07/09 01:15:48 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
define('HTTP_SERVER', 'http://pieceful-dreams.com'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', true); // secure webserver for checkout procedure?
define('HTTP_COOKIE_DOMAIN', 'http://pieceful-dreams.com/catalog/');
define('HTTPS_COOKIE_DOMAIN', '');

dstwcolr
7-18-05, 07:38 PM
You have bigger problems than just the USPS module. I tried to run a test order for you, as Billy Tester. Nothing stays in my cart even after I signed in. It keeps telling me my cart Is empty. I never made it to checkout to check the USPS module...
Sorry,
Moon

Yes I have noticed that myself just started that today. I was able to get to the check section once but it stopped right at the USPS section and couldn't go any farther.

stevel
7-18-05, 09:04 PM
Well, that will certainly do it! Try this:
define('HTTP_SERVER', 'http://pieceful-dreams.com'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://pieceful-dreamscom.secure.powweb.com'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', true); // secure webserver for checkout procedure?
define('HTTP_COOKIE_DOMAIN', 'pieceful-dreams.com');
define('HTTPS_COOKIE_DOMAIN', 'pieceful-dreamscom.secure.powweb.com');

This should get you going, and then we can look at the USPS issue.

dstwcolr
7-20-05, 12:10 PM
ok when I replaced the original lines with those you have posted here I now get page cannot be displayed when I try to log in. I since have gone back to the original text until I figure this out.

Tina

dstwcolr
7-31-05, 02:48 PM
Why is it when I replaced my lines with the ones you have posted here I got page can not be displayed. HMMMMMM

stevel
7-31-05, 08:34 PM
What page can't be displayed?

I looked at your site and it looks ok other than you have disabled SSL.

dstwcolr
8-1-05, 02:33 AM
When I copied and pasted teh text you created for me then saved I couldn't get the shopping cart to work all I got was page could not be displayed so I put the text back to it's original format. I don't know what I did wrong as I only pasted the lines you changed nothing else.

dstwcolr
8-2-05, 02:56 PM
Ok this morning I went through and just copied and pasted the changes you posted here. Now the login screen comes up as page cannot be displayed. same if I try clicking the "my account" link

stevel
8-2-05, 04:14 PM
You don't have DIR_WS_HTTPS_CATALOG defined. It should have the same value as DIR_WS_HTTP_CATALOG.

Also, your images are very large - 301KB for the first one I looked at.

dstwcolr
8-3-05, 11:24 PM
I changed it and get the same error page cannot be displayed. I am pulling my hair out here and about ready to through my puter out the window. I am sure my client isn't to thrilled either LOL.

stevel
8-4-05, 11:53 AM
You changed it, but you didn't make it match.. You left off the slash at the end.

dstwcolr
8-4-05, 12:12 PM
Man I wish I could tap into your brain and download your techie smarts LOL. that worked but I am having some wierd things happen. I add things to my carts and somtimes they go in sometime it will pop up and cart is empty when there is 3 items in it. Then I will delete an item refresh the item will be gone I will go to a different section go back to cart contents and either cart will be empty again or the deleted item will be back. I think I have gremlins!!!!

stevel
8-4-05, 02:00 PM
You have other errors in your configure.php file. Post the first 20 lines.

dstwcolr
8-4-05, 06:01 PM
define('HTTP_SERVER', 'http://pieceful-dreams.com'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://pieceful-dreamscom.secure.powweb.com'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', true); // secure webserver for checkout procedure?
define('HTTP_COOKIE_DOMAIN', 'pieceful-dreams.com');
define('HTTPS_COOKIE_DOMAIN', 'pieceful-dreamscom.secure.powweb.com');

stevel
8-4-05, 08:34 PM
Ok, that's five. Where are the other 15? Show me everything except the database defines at the end. And fetch a copy from the server rather than posting what's on your local PC - they may be different.

dstwcolr
8-6-05, 10:28 PM
define('HTTP_SERVER', 'http://pieceful-dreams.com'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://pieceful-dreamscom.secure.powweb.com'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', true); // secure webserver for checkout procedure?
define('HTTP_COOKIE_DOMAIN', 'pieceful-dreams.com');
define('HTTPS_COOKIE_DOMAIN', 'pieceful-dreamscom.secure.powweb.com');
define('HTTP_COOKIE_PATH', '/catalog/');
define('HTTPS_COOKIE_PATH', '');
define('DIR_WS_HTTP_CATALOG', '/catalog/');
define('DIR_WS_HTTPS_CATALOG', '/catalog/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
define('DIR_FS_CATALOG', '/www/p/piecefuldrea/htdocs/catalog');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

stevel
8-7-05, 07:32 AM
This is wrong:
define('HTTPS_COOKIE_PATH', '');
You want:
define('HTTPS_COOKIE_PATH', '/catalog/');

dstwcolr
8-7-05, 08:03 AM
Thanks, Steve I changed it but having same issue. I can log in add things to cart but its not keeping correct cart contents.

dstwcolr
8-7-05, 08:19 AM
I don't know whether to scream or to cry now when I try and log into my catalog admin I get this error at top of page.

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /www/p/piecefuldrea/htdocs/catalog/admin/includes/functions/database.php on line 19
Unable to connect to database server!

I looked up that line and its the database login and password but in the config file it is correct as I just checked it 3 times and verified the password.

stevel
8-7-05, 10:46 AM
Since your catalog itself works, look carefully at catalog/admin/includes/configure.php and make sure the defines are correct there and that there is no space after the server name. Note that I refer to the configure.php under catalog/admin/includes, which is different from the one under catalog/includes.

I'd also comment that since you seem to be introducing errors into the configure.php each time you edit it, you should slow down and check your work.

dstwcolr
8-7-05, 02:39 PM
I really appreciate your help I think I would have deleted this entire cart and gone paypal by now if it weren't for you keeping me going. THANKS!!!!

My personal cart didn't give me half this much trouble and I don't remember doing all this configure changes. Well anyway. The admin page comes up now but nothing else all others show as page cannot be displayed.

Main cart is still not working properly the cart contents bounces from not having anything in it when I place an item in there, to having several items that I deleted previous. why would it do this?

stevel
8-7-05, 08:40 PM
Again, it all boils down to errors in your configure.php files. In the admin case, the catalog/admin/configure.php define of HTTP_SERVER is used to access the sub-pages of admin. That in comjunction with DIR_WS_ADMIN. If you made the common mistake of uploading your store configure.php over the admin one, you could have this symptom.

Please make sure that STORE_SESSIONS is defined as 'mysql' in both files.

dstwcolr
8-8-05, 12:23 PM
ok I have the admin part of it fixed but still having cart contents issues. I have checked and rechecked to see if I am missing someing but I just don't see it. It could be sitting there staring me in the face but I don't see it. Maybe a sceond pairs of eyes would help. What did I do wrong this time?

here are the lines of the catalog/includes/configure.php up to the database section which is correct.

define('HTTP_SERVER', 'http://pieceful-dreams.com'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://pieceful-dreamscom.secure.powweb.com'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', true); // secure webserver for checkout procedure?
define('HTTP_COOKIE_DOMAIN', 'pieceful-dreams.com');
define('HTTPS_COOKIE_DOMAIN', 'pieceful-dreamscom.secure.powweb.com');
define('HTTP_COOKIE_PATH', '/catalog/');
define('HTTPS_COOKIE_PATH', '/catalog/');
define('DIR_WS_HTTP_CATALOG', '/catalog/');
define('DIR_WS_HTTPS_CATALOG', '/catalog/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
define('DIR_FS_CATALOG', '/www/p/piecefuldrea/htdocs/catalog');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

dstwcolr
8-12-05, 01:53 AM
I figured it out and it is working fine now can we figure out why the USPS part is not working. LOL other words back to the original reason for this post to begin with.

stevel
8-12-05, 10:10 AM
So what exactly is the problem now?

dstwcolr
8-17-05, 12:13 PM
Just wanted to let you know I got the shipping error fixed. I went to teh OSCommerce forum and searched through the questions. Found my answer and it was really very simple.

I really want to thank you Steve for all teh help you gave me on these and other issues. Your very kind and patient with us beginers.

Tina