Forums / Built-in Shipping and Payment Modules / Estimate shipping - shipping estimator bug

Estimate shipping - shipping estimator bug

Locked

Started by bjoly on 23 May 2006, 5:05 PM · Views: 4,503

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
23 May 2006, 5:05 PM
#1
bjoly avatar

bjoly

New Zenner

Join Date:
May 2006
Posts:
28
Plugin Contributions:
0

Estimate shipping - shipping estimator bug

I am setting up a new zen cart store and am having a problem with the shipping estimator. It works fine when installed on my local server (Windows XP laptop with Apache, MySQL, PHP) but fails after uploading to the server (Linux, Apache, MySQL, PHP).

The Problem:
When the customer clicks on 'Estimate Shipping' in the shopping cart the popup window displays and tries to load the shipping rates. Unfortunately the rates never load and after several seconds it times out.

Possible Reasons for the Problem:

  1. Permissions set too strict?
  2. Server issue? Sessions?

Any ideas?

24 May 2006, 7:10 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Estimate shipping - shipping estimator bug

Do the shipping quotes all load in the check out?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

24 May 2006, 10:48 PM
#3
bjoly avatar

bjoly

New Zenner

Join Date:
May 2006
Posts:
28
Plugin Contributions:
0

Re: Estimate shipping - shipping estimator bug

Ajeh:

Do the shipping quotes all load in the check out?

Yes, actually. But there's a catch to this problem. I just discovered that some modifications I made to the system may be at fault. Essentially what I have is a chunk of code in the includes/classes/shipping.php file which disables certain shipping modules depending on the product types ordered or the customer's country. This code works just fine but with one exception. I am querying the customer_basket tables for the products. This table is only populated once the customer has created an account and therefore only works during checkout. The solution to this problem is to query the sessions.

I'll need to retrieve the product id's from the shopping cart. This will require traversal of that ugly session variable(?). Zen-Cart should have numerous functions for working with sessions. Hopefully I can find the right ones to use. Perhaps you could offer some guidance here. Once I can successfully create an array of product type id's using the session then everything should work just fine.


I highly recommend that future versions of Zen Cart be enhanced with the following features:

  1. Shipping and Payment modules should offer product type and ship to country constraints. This would allow store owners to restrict shipping and payment options based on customer location and/or product type(s) ordered.

  2. Enhanced Zen-Cart Search. I've posted this request at http://www.zen-cart.com/forum/showthread.php?t=36607. Please reply to it with any recommendations or suggestions.

Thanks,

bjoly

26 May 2006, 7:32 PM
#4
bjoly avatar

bjoly

New Zenner

Join Date:
May 2006
Posts:
28
Plugin Contributions:
0

Re: Estimate shipping - shipping estimator bug

Well, I changed my code to use the session cart object rather than the database and it seems to be working okay. But I am having an issue now with the UPS module. It seems to only return quotes if the total shopping cart weight is less than 136 pounds. This may also be a problem for the USPS module. Please note that I am using version 1.2.6d, so perhaps this issue has been addressed.

Perhaps the solution to this problem is to quote each item individually or as separate boxes. For example, say my customer ordered 2 of item A (2 lbs) and 3 of item B (5 lbs). Rather than quote one box at 19 lbs, could I quote it as five separate packages at 2, 2, 5, 5, and 5 lbs and then total each item? This would allow the customer to buy more products through the shopping cart.

Any helpful thoughts or suggestions would be greatly appreciated.

Best Regards,

bjoly

26 May 2006, 7:48 PM
#5
bjoly avatar

bjoly

New Zenner

Join Date:
May 2006
Posts:
28
Plugin Contributions:
0

Re: Estimate shipping - shipping estimator bug

The USPS module has the same problem as the UPS module. The max weight allowed to get a rate quote is 70 pounds. The products sold can be fairly large so UPS and USPS shipping quotes cannot be limited 135 and 70 pounds. If anyone knows of a quick solution to quote higher weights with USPS or UPS, then I'd certainly like to know.

Thanks,

bjoly

26 May 2006, 10:47 PM
#6
bjoly avatar

bjoly

New Zenner

Join Date:
May 2006
Posts:
28
Plugin Contributions:
0

Re: Estimate shipping - shipping estimator bug

bjoly:

The products sold can be fairly large so UPS and USPS shipping quotes cannot be limited 135 and 70 pounds.

The problem I'm having with the current setup is that UPS and USPS think the order ships as one box. Once one understands this logic it is easy to see why you cannot get rates for anything over 135 lbs (UPS) or 70 lbs (USPS).
This is simply because you cannot ship single boxes with these weights.

I think the quickest solution to this problem is to get a separate quote for each product ordered and add up the rates for each one. This total would become the quoted shipping cost.

Any product over the maximum weight limit would be entered into the catalog as a different product type, such as 'Product - oversize' for anything between 70 and 135 lbs, and 'Product - LTL' for anything over 135 lbs. Some custom PHP scripting could determine whether the product type has been ordered and to disable USPS if 'Product - oversize' or 'Product - LTL' are found and UPS if 'Product - LTL' is found. For 'Product - LTL' product types, the only available shipping option would be ''Rate to be Determined". I suppose if you really want to go crazy you could create a shipping module for Yellow, Old Dominion, Overnite, FedEx Freight, or whatever other carrier you use.

26 May 2006, 10:54 PM
#7
bjoly avatar

bjoly

New Zenner

Join Date:
May 2006
Posts:
28
Plugin Contributions:
0

Re: Estimate shipping - shipping estimator bug

bjoly:

I think the quickest solution to this problem is to get a separate quote for each product ordered and add up the rates for each one. This total would become the quoted shipping cost.

Perhaps an easier but less precise solution is to quote the average weight of the purchased items and then multiply the returned rate by the quantity ordered. This would at least allow the customer to order more items. Restrict USPS quotes to orders without 'oversize' or 'ltl' product types. Similarly restrict UPS quotes to 'oversize' items and under.

30 May 2006, 10:36 PM
#8
bjoly avatar

bjoly

New Zenner

Join Date:
May 2006
Posts:
28
Plugin Contributions:
0

Re: Estimate shipping - shipping estimator bug

bjoly:

Perhaps an easier but less precise solution is to quote the average weight of the purchased items and then multiply the returned rate by the quantity ordered. This would at least allow the customer to order more items. Restrict USPS quotes to orders without 'oversize' or 'ltl' product types. Similarly restrict UPS quotes to 'oversize' items and under.

Well the shipping estimator is working quite nicely now. I have not yet made the modifications to the USPS and UPS modules. These will come later. For now, USPS is disabled for any order over 70 lbs and UPS is disabled for any order over 135 lbs.

NOTE: I wasted several hours after uploaded my updated code to the webserver. The shipping estimator would get stuck whenever it tried connecting with USPS.com. This error had me completely baffled as it worked just fine my laptop. The problem turned out to be a locked up or stalled Apache httpd process on the host's server. This caused all rate requests to USPS.com to freeze. Once the processes were restarted everything worked without a problem. If you think your are having this problem, then please contact your host.

31 May 2006, 1:55 AM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Estimate shipping - shipping estimator bug

Thanks for the update ... appreciate it ... always a help to others to learn about the ... unexpected ... :cool:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!