Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / USPS handling charges

USPS handling charges

Views: 2,898

Results 1 to 20 of 20
17 Jun 2011, 7:12 PM
#1
roryg1 avatar

roryg1

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

USPS handling charges

A wee bit o help on USPS. I charge a $2.50 handling fee on USPS to cover insurance since there is no insurance level entry in config. The problem is on small inexpensive items it makes the shipping charges too high. Is there any way to hard code ... If order total is less than $XX then handling fee = $0 ? I don't know where to put this in the calculations. Been looking but can't figure it out. -- R

17 Jun 2011, 11:02 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: USPS handling charges

If you wanted to do this on orders less than $10.00 ...

Change the code from:

          $cost = preg_replace('/[^0-9.]/', '',  $cost);
          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );

to read:

          $cost = preg_replace('/[^0-9.]/', '',  $cost);

          global $cart;
          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost * $shipping_num_boxes) + ($_SESSION['cart']->show_total() < 10.00 ? 0.00 : (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING)) );

        }
18 Jun 2011, 2:53 AM
#3
roryg1 avatar

roryg1

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Re: USPS handling charges

I promise I'm not always this dumb. I assume this is in usps.php. I am using 1.3.7.1. and it looks different if this the the correct file.

18 Jun 2011, 2:56 AM
#4
roryg1 avatar

roryg1

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Re: USPS handling charges

'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type),

      'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
      */
      $methods[] = array('id' => $type,
                         'title' => $title,
                         'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
18 Jun 2011, 3:09 AM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: USPS handling charges

I am using 1.3.7.1
Upgrade

18 Jun 2011, 3:18 AM
#6
roryg1 avatar

roryg1

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Re: USPS handling charges

That line of code to replace is from 1.3.9 not 1.3.7. I just looked at a clean usps.php from 1.3.7 and it matches my file not the recommended edit. Upgrading is coming but not for a while. Fortunately the store is busy.

18 Jun 2011, 3:33 AM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: USPS handling charges

Upgrading is coming but not for a while. Fortunately the store is busy.
Do it as the tutorial recommends and your only down for a short while during your change

18 Jun 2011, 4:32 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: USPS handling charges

NOTE: regardless of v1.3.9 or v1.3.7 ... you should be using the current Upgraded USPS January 2, 2011 C version from post #26 of:
http://www.zen-cart.com/forum/showthread.php?t=171314

NOTE: you really need to upgrade to v1.3.9h as you have such buggy, insecure out of date code ...

18 Jun 2011, 4:52 AM
#9
roryg1 avatar

roryg1

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Re: USPS handling charges

Yes, I know. The issue is that I have a bunch of edits like the one I'm doing here and a lot of contributions installed so it's not an easy job. I also have some custom work done by an outside contractor. I decided it would be easier to build a new cart from scratch so that's what I'm doing. I'm trying the match what I have less the 5 years of mistakes but in the mean time this seemingly minor shipping issue is costing me a lot of bailed carts.

18 Jun 2011, 12:59 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: USPS handling charges

Get the USPS January 2, 2011 C version of the current usps.php and use that ...

Note: on an old version of Zen Cart you will also probably need to edit the line in post #35 as well ...

18 Jun 2011, 1:18 PM
#11
roryg1 avatar

roryg1

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Re: USPS handling charges

I appreciate all the answers. I know it takes time for everyone.

18 Jun 2011, 5:53 PM
#12
roryg1 avatar

roryg1

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Re: USPS handling charges

Thank You again. I installed the USPS January 2, 2011 usps.php and did the edit you gave me and it works fine.

19 Jun 2011, 3:29 PM
#13
it2steve avatar

it2steve

New Zenner

Join Date:
Feb 2011
Posts:
22
Plugin Contributions:
0

Re: USPS handling charges

I am not trying to hijack the thread but I didn't want to start a new one as the title is along the same lines.

I recently opened up shipping everywhere (I used to just have US and Canada) but was wasting to know hoe to change the handling fee based on location.

For example, $1 fee for US / $5 everywhere else.

I did a search and the only thing I could find was some added code is the usps.php from 2006 (which didn't work). Based on what I read here things are quite different since then.

I am current with my module and cart. Any help would be appreciated. Thanks!

-steve @ https://www.electronicCrap.com

20 Jun 2011, 9:31 AM
#14
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: USPS handling charges

it2steve:

For example, $1 fee for US / $5 everywhere else.

Setup your ones and clone the USPS module and set for zone

https://www.zen-cart.com/tutorials/index.php?article=189

20 Jun 2011, 10:30 AM
#15
it2steve avatar

it2steve

New Zenner

Join Date:
Feb 2011
Posts:
22
Plugin Contributions:
0

Re: USPS handling charges

so with that being said, since I have not defines any 'zones' I would need to create a zone for world shipping then duplicate the shipping module (one for each zone)?

20 Jun 2011, 10:40 AM
#16
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: USPS handling charges

it2steve,
That is the prescribed method and doing it this way the correct ship module will be presented based upon the address/country/zone

20 Jun 2011, 1:25 PM
#17
it2steve avatar

it2steve

New Zenner

Join Date:
Feb 2011
Posts:
22
Plugin Contributions:
0

Re: USPS handling charges

sorry to be a pest. I followed the tutorial, cre3ated a duplicate module called uspsintl however it doesn't want to play nice.

I copied the .php from the module/shipping and the /language as well. went through both files and renamed usps to uspsintl keeping the cases' the same

The second module isn't showing. I know that I must be missing something pretty simple here and I'm sorry for the troubles. I am just wanting to charge a little extra for the additional work that is involved with international shipping.

20 Jun 2011, 1:39 PM
#18
it2steve avatar

it2steve

New Zenner

Join Date:
Feb 2011
Posts:
22
Plugin Contributions:
0

Re: USPS handling charges

ok, have the second module showing and it seems to pick up the international fee.

I had to change my US/CANADA zone to just US for the regular usps.php with the intention of having the 'intl' usps picking up the canada fees but it's not quoting them in the estimator. Any thoughts on that?

20 Jun 2011, 1:41 PM
#19
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: USPS handling charges

Do you have 2 zones??

US
The rest of the world? that includes Canada?

20 Jun 2011, 1:52 PM
#20
it2steve avatar

it2steve

New Zenner

Join Date:
Feb 2011
Posts:
22
Plugin Contributions:
0

Re: USPS handling charges

I do now... That actually made it a little worse. Been doing some trial and error to figure this out:

As odd as it sounds, I had the duplicate modules (usps and uspsintl) set up identical EXCEPT for the shipping options; one was set to priority the other priority international (NO ZONES selected on either) it seemd to work in testing.

I put a $100 handling fee for the uspsintl (just to test) and when I selected a US address and zip it looked correct and if I selected the Bahamas it showed the huge fee. Canada for some reason would NOT work. I figured that it was like the US and needed a city/zip so I found a zip for Qubec and used it but nothing is showing either way.

kobra - do you freelance? I'm sure there is plenty more that needs to be done to my site but I have a 'real' job and the site stays REALLY busy for me to risk bringing it down, this is stressful enough as it is...