Recommended Posts

This is a very simple module, with no bells and whistles, except that you can choose the allowable shipping methods.

I know that some people wanted that, and it is available now.

The script is completely updated, with proper use of XML data, and better (less intrusive) fixes to the html characters than what were previously done.

USPS methods eventually got to over 1000 lines of very inefficient code and required modifications to half a dozen pages. This script is under 200 lines of code, and requires only 3 modifications in 2 pages.

Even if/when all the bells and whistles are applied to this code, it should require less than half the coding and strain as USPS Methods.

A link to the contribution will be uploaded shortly. I needed to get a forum thread going first, so that it could be included with the contrib.

Share this post

Link to post

Share on other sites

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

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

Share this post

Link to post

Share on other sites

I have uploaded a couple more versions - and will continue to do so until I have the module where I personally want it. I figure it'll be nice to give different options because not everybody has the same shipping needs.

Some of the int'l options weren't showing up in 1.0 b/c of the dimensions (first class was fine. It was flat rate boxes that I wasn't getting). It took a bit of playing to find dimensions that returned all packages, but I did find them and they are set up in v1.1 - that means that you do not need to set dimensions from the admin panel, like with previous versions (less clutter).

Everyone, please note, that in order for the module to work, you must uninstall the old version before installing the new one. Otherwise, you'll end up with junk configurations that will interfere with the new module. To remove them, you either need to put the old file back and reinstall/uninstall, or manually search and remove all USPS entries from your configuration table in your database.

This module is NOTHING like the old ones. The scripting is entirely different. The html character replacements are different. There may even be straggling code in other files that you are free to remove once you install this. I have two goals when scripting now. 1. Do not intrude on the core project unless that is the actual intent of the add on, and 2. Efficiency. What was taking over 1000 lines of code, can be done in less than 300. Less redundant script means less crap for your server to read through, faster page loads, etc...

My hope is to get in the options, without cluttering the admin panel. One script can't meet everybody's needs without becoming too much. So, I'll hit the basic needs, and the stuff that I personally want. I suspect, working on it here and there, I'll have that done within a week or so.

@ Pederb - I do not have one single ereg_replace function in this script. So, you're getting that from somewhere else. You do need to remove the functions that were installed with the prior USPS modules. They are not necessary. So far, only ONE tep function is required for what I've got written. The rest can be removed (in both catalog functions, and admin functions). You just have to locate them.

I don't know that dreamweaver can be used as a text compare tool without downloading/integrating other applications. That being the case, it makes sense to use a standalone text compare tool. I personally use beyond compare. Winmerge is a popular free tool.

Anybody who is going to be installing / uninstalling, or modifying files, NEEDS to have a compare tool. It is so much easier and faster than going through instructions line by line. I don't like writing instructions any more than I like reading or following them. So, you'll find that my contributions won't include them unless it's a real simple install. And even if they do, it might not be completely "accurate". But one thing I will always do is mark any changes in comments like this // EXAMPLE START ...... // EXAMPLE END. I will comment out old lines and not comment new lines. Changes will be easy to find and easy to undo.

Share this post

Link to post

Share on other sites

Just uploaded some upgrades. Separate handling fees for each shipping method, insurance (and any other available extra service), and ability to show shipping regulations to international customers. This will be most beneficial for those running 2.3.1 shops, but will also work on 2.2 shops. The older shops just won't be able to show extra services or regulations.

Despite the fact that it does take up some room in admin (due to the large number of shipping methods, it is tucked into a nice neat little package, isn't sloppy, and should not be confusing.

Share this post

Link to post

Share on other sites

Thanks for taking the time to release this contribution! I installed it today and wanted to give you some feedback. This contribution as well as other shipping modules needs updated instructions on the admin/modules.php for the dynamic template contribution commonly found on TemplateMonster shops. I will post them here once I have figured out a solution.

Additionally, I think I may have uncovered a bug in the usps.php shipping class. That is, a minimum of two usps shipping options are required for the module to display anything. For example, if I only want to offer priority mail then the module doesn't display any options. However, if I offer priority mail and medial mail, both options will display.

Just some more cents to add to your collection :)

- Ryan

Share this post

Link to post

Share on other sites

If the dynamic template requires changes to the shipping mods, then perhaps, the dynamic templates should either be rewritten, so that they don't intrude on already existing scripts, or the dynamic templates contributor(s) should take the time to supply the necessary updates for the mods that their script intrudes on, don't you think? If they can't make it a one size fits all, then they need to invest the time in staying up to date with CORE mods and issuing compatibility packets along the way. Seems to me it would be easier (and make more sense) to write a script that works with the existing OSC core, than it does to force changes to the core and all surrounding mods so that an incompatible contribution will fit like it would if it had been written thoughtfully in the first place. Incompatibility of another contribution isn't a shipping mod issue. It's a distinct issue that needs to be dealt with by the creator of that contribution. Those are my cents on that.

The issue with needing to choose 2 shipping methods is in fact a bug. I've found the reason and fixed that and I will upload a new package momentarily.

I'm not sure what you mean. First I need to mention that this isn't the old USPS methods. The option isn't to display insurance as text just to inform the customer that their package is insured, but rather to display any add on services as a break down of the total cost, if you choose to display it.

Your choice is to:

1. Not use the service

2. Use the service (which the customer pays for), bundle it into the cost of the shipping methods, and NOT SHOW the customer a breakdown of their shipping costs.

3. Use the service (which the customer pays for), bundle it into the cost of the shipping methods, and SHOW the customer a breakdown of their shipping costs.

For option three, before the breakdown will be displayed, the customer must choose a shipping option. Once the option is selected, they will see (Show Details). When they click on that, it will give them a breakdown (base, handling, delivery confirmation, insurance, etc...). The page gets far too sloppy if you display everything at once. So, it is only displayed on an as needed/wanted basis.

Just because you choose an option, does not mean it will be available, or that it will be charged, hidden or displayed. If USPS doesn't offer the service for whatever reason, then your selection is moot.

USPS may not offer a service for a variety of reasons:

a. Value exceeds insurable value

b. Service is only available at counter and you chose internet rates, or vice versa

c. Service not available for shipping type

d. Service is not available to destination country

e. etc......

If you choose it, and IF USPS returns it, then it will be charged and added (and displayed if you choose to display it). This module is based strictly on what USPS offers, based on the input that comes from your cart and your admin settings. It isn't designed to be custom suited for anything outside of USPS package options and services.

Another point that I need to make. The script pulls ALL available information and sorts/charges/displays based on what you give it. If you choose two services that are redundant or incompatible per USPS offerings, both of those services will be returned. It's up to you to know what is and isn't appropriate for your shop and your customers. For example, don't choose "registered mail without insurance" PLUS insurance, or vice versa, don't choose regular registered mail, but forget to choose insurance along with it. And there is no sense in displaying both delivery confirmation AND signature confirmation, as these are redundant and SC rules out DC.

Share this post

Link to post

Share on other sites

If the dynamic template requires changes to the shipping mods, then perhaps, the dynamic templates should either be rewritten, so that they don't intrude on already existing scripts, or the dynamic templates contributor(s) should take the time to supply the necessary updates for the mods that their script intrudes on, don't you think? If they can't make it a one size fits all, then they need to invest the time in staying up to date with CORE mods and issuing compatibility packets along the way. Seems to me it would be easier (and make more sense) to write a script that works with the existing OSC core, than it does to force changes to the core and all surrounding mods so that an incompatible contribution will fit like it would if it had been written thoughtfully in the first place. Incompatibility of another contribution isn't a shipping mod issue. It's a distinct issue that needs to be dealt with by the creator of that contribution. Those are my cents on that.

Jetta,

Thanks for taking some time to fix the bug in the USPS class, I really appreciate it! As of today the contribution is running as desired :)

In regards to the dynamic template system (DTS) I didn't do justice in explaining the issue thoroughly. I agree with your point that an intruding script should be maintained by it's author if it changes another contribution or affects core usage. In this situation it is not the case that the DTS intrudes on the USPS module, but, that each contribution attempts to process the information differently. In admin/modules.php the USPS contribution implodes $value if is_array($value) returns true, whereas, the DTS contributions incorporates it's own processing if is_array($value) is true.

I have seen many contributions with additional instructions to help users complete common tasks both big and small. For example, many contributions include separate instructions for the STS contribution. Being consistent with this idea would provide a great benefit to more users and foster a stronger community. As a resource to others I am going to post the changes I made here. I hope you would consider including them as additional instructions in future releases.

Share this post

Link to post

Share on other sites

Thanks again for releasing this contribution, it's a huge help! I wanted to point out some errors I encountered to see if you or others are having them as well? As they are E_NOTICE errors it doesn't seem to affect functionality from what I can see.

Link to post

Share on other sites

The checkout isn't stock. It's a brand spanking new single page checkout, but the options work exactly the same in stock checkout. Unfortunately though, you won't be able to get into the admin area.

I am presently adding a few more thing to it, so if things get wacky, that will be why.

This is the second day I have tried the website with no luck:

The connection has timed out

The server at www.fulluvscents.com is taking too long to respond.

I can ping your server but it isn't responding to http requests.

Okay. Just loaded this: "Fulluv Scents is temporarily offline while we perform some maintenance. I apologize for the inconvenience. If you need anything while we're down, just email me jetta@@fulluvscents.com Or, look for Fulluv Scents on eBay"