Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] - USPS Methods


Recommended Posts

In includes/classes.xml_5.php, find this code (lines 25-26)

 

 $xml_parser = &new XML();
$data = &$xml_parser->parse($xml);

 

and replace it with this

 

 $xml_parser = new XML();
$data = $xml_parser->parse($xml);

 

I haven't tested that, so please let me know if it works.

 

Regards

Jim

 

Hi Jim,

 

That took care of that, but now when clicking save I get this,

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/*****/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/*****/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/*****/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/*****/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/*****/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/****8/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/*****/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/*****/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/*****/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/******/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/*****/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/******/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/******/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/******/modules.php on line 40

 

Deprecated: Function ereg_replace() is deprecated in /home/wihirt/public_html/catalog/******/modules.php on line 40

 

Warning: Cannot modify header information - headers already sent by (output started at /home/wihirt/public_html/catalog/addy/modules.php:40) in /home/wihirt/public_html/catalog/******/includes/functions/general.php on line 34

 

Please advice

 

Cheers

Edited by pederb
Link to comment
Share on other sites

It appears that you're trying to run an old version of osCommerce on PHP 5.2 or higher. You're going to have a lot of these warnings that need to be fixed or hidden. If you want to do all that work, try searching the forum for "Function ereg_replace() is deprecated" (without the quotes.)

 

It might be easier for you to start with osC 2.3.1, since it already is PHP 5.2 compatible, and just move over your products and customers.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

It appears that you're trying to run an old version of osCommerce on PHP 5.2 or higher. You're going to have a lot of these warnings that need to be fixed or hidden. If you want to do all that work, try searching the forum for "Function ereg_replace() is deprecated" (without the quotes.)

 

It might be easier for you to start with osC 2.3.1, since it already is PHP 5.2 compatible, and just move over your products and customers.

 

Regards

Jim

 

Hi Jim,

 

I do have 2.3.1

Link to comment
Share on other sites

Hi Jim,

 

I do have 2.3.1

 

No, you do not. 2.3.1 does not use ereg_replace() anywhere. If you started with 2.3.1, you have overwritten files with older 2.2x files. This is a really bad idea, and will cause you all sorts of problems. You should put the 2.3.1 version of the file back up and make any changes needed by hand.

 

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@tomalok & @@sml - We are in the same boat. Did you guys find a solution?

 

Ok, here is what I did, I uninstall 6.1a, reinstall 5.2.2 and change 3 lines of code and it works like a charm.

 

'First-Class Mail Int Package' => 'First-Class Mail regimark International Package**',

to

'First-Class Mail Int Package' => 'First-Class Mail regimark International Parcel**',

 

'First-Class Mail regimark Package';

to

'First-Class Mail regimark Parcel';

 

case 'First-Class Mail regimark Package':

to

'First-Class Mail regimark Parcel';

Edited by sml
Link to comment
Share on other sites

Someone emailed me about international first class not working. Don't have time to sort through the thread and find the post.

 

But, I don't see any problems with int'l first class. Remember, it only works for up to 4 lbs.

Link to comment
Share on other sites

No, you do not. 2.3.1 does not use ereg_replace() anywhere. If you started with 2.3.1, you have overwritten files with older 2.2x files. This is a really bad idea, and will cause you all sorts of problems. You should put the 2.3.1 version of the file back up and make any changes needed by hand.

 

Regards

Jim

 

Are you saying that your contribution do not work on the newer 2.3.1?

 

Cheers

Link to comment
Share on other sites

My contribution? I didn't write this one. No, I was telling you the correct way to add 2.2x code into 2.3.1.

 

REgards

Jim

 

Ok, any idea how to correct this?

 

Cheers

Link to comment
Share on other sites

Hey guys. Wow. Ya know, I think I've got 5.2.1 or 5.2.2 running on my site (osc2.2). I never ran into any issues with the changes on the 22nd. Everything is fine and dandy.

 

I did decide to write a new module though because well, I'll be honest. The scripting for the old one was pretty hacked up. This one was written and tested on a 2.3.1 site. It is a very stripped down module, without any frills. I figured I would upload it at it's barest point and add to it from there. I will be the sole maintainer of that contribution so the updates will stay clean and understandable.

 

Note that USPS methods has gotten to a whopping file size, with FAR too many intrusions into the database, other pages, etc... It's actually gotten downright silly. Not everyone wants to spend an hour or two or DAYS uploading and dealing with the frustration of what should be a simple postage calculator. And unfortunately, stock 2.3.1 doesn't even come with a V4 compatible module. So, hopefully, this will fit the bill for those who want a working, efficient, and very easy to install USPS shipping calculator.

 

The new module can be found here:

http://addons.oscommerce.com/info/8327

 

And I have started a support thread here:

http://www.oscommerce.com/forums/topic/383307-usps-rate-v4-intl-rate-v2-official-support-thread/

Link to comment
Share on other sites

Quick ?. I'm on 5.0.1 methods. Is going to 5.2.2 just a switch of usps.php or are there other code changes elsewhere? At work and can't d/l the file. I noticed my first-class rates for international are really high for some reason. Even at .01lb its like $6 shipping instead of like $3.50 or so.

Link to comment
Share on other sites

Hey guys. Wow. Ya know, I think I've got 5.2.1 or 5.2.2 running on my site (osc2.2). I never ran into any issues with the changes on the 22nd. Everything is fine and dandy.

 

I did decide to write a new module though because well, I'll be honest. The scripting for the old one was pretty hacked up. This one was written and tested on a 2.3.1 site. It is a very stripped down module, without any frills. I figured I would upload it at it's barest point and add to it from there. I will be the sole maintainer of that contribution so the updates will stay clean and understandable.

 

Note that USPS methods has gotten to a whopping file size, with FAR too many intrusions into the database, other pages, etc... It's actually gotten downright silly. Not everyone wants to spend an hour or two or DAYS uploading and dealing with the frustration of what should be a simple postage calculator. And unfortunately, stock 2.3.1 doesn't even come with a V4 compatible module. So, hopefully, this will fit the bill for those who want a working, efficient, and very easy to install USPS shipping calculator.

 

I'm on 5.0.1 and was fine by changing "package" to "parcel". I did notice my first class int. rates are a bit high no matter what I do. I decided to up to 5.2.2 but when I click edit to go in and adjust the settings in the module it just gets a blank page, well it expands the page with the list of modules and does nothing. Any idea. I skipped step 10 like it says if going from a previous version.

Link to comment
Share on other sites

Ok, here is what I did, I uninstall 6.1a, reinstall 5.2.2 and change 3 lines of code and it works like a charm.

 

'First-Class Mail Int Package' => 'First-Class Mail regimark International Package**',

to

'First-Class Mail Int Package' => 'First-Class Mail regimark International Parcel**',

 

'First-Class Mail regimark Package';

to

'First-Class Mail regimark Parcel';

 

case 'First-Class Mail regimark Package':

to

'First-Class Mail regimark Parcel';

 

This worked perfectly. But I tend to agree that this contrib makes A LOT of database queries that seem unnecessary. When USPS Rate V4 Intl Rate V2 - v.1.0 has a little more functionality, like adding handling fees to different classes, I think I will install this so my site runs more efficiently. Thanks again!!!

Link to comment
Share on other sites

http://addons.oscommerce.com/info/8327

 

is fully stabilized and matured. My intent was to start with simple, and add features, so that there would be some options. Some people want the features (me), and some don't. No need to force it on them.

 

I would recommend testing it. If you run into any bugs, then please report them on the appropriate forum. With the exception of any potential bugs (which I don't anticipate whatsoever), this is what it is, and there won't be any additional options or features.

http://www.oscommerce.com/forums/topic/383307-usps-rate-v4-intl-rate-v2-official-support-thread/

 

Jetta

Link to comment
Share on other sites

Downloaded latest version & updated.

 

Still working fine, however not getting first class shipping option. Threshold is set for 12. Item in cart shows as 1 pkg, 0.39 lbs total

 

Media Mail, Priority Etc are all showing. All the options for first class are also checked.

 

Any idea why these are not showing up? Thank you

 

Kieran Mullen

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...