Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / USPS Flat Rate not an option

USPS Flat Rate not an option

Views: 2,970

Results 1 to 12 of 12
22 Nov 2010, 4:02 PM
#1
ktfmissions avatar

ktfmissions

New Zenner

Join Date:
Nov 2010
Posts:
2
Plugin Contributions:
0

USPS Flat Rate not an option

We will be using only USPS for our shipping. We have tested the USPS module and it is working and live. However, there isn't an option for USPS flat rate on domestic ($4.95) It is showing a flat rate for International. How do we get the USPS flat rate as an option?

(We are using v1.3.9h)

Thank you.

22 Nov 2010, 7:29 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: USPS Flat Rate not an option

You can customize your USPS shipping module:
/includes/modules/shipping/usps.php

and set the size of the box for Priority ...

          //PRIORITY MAIL OPTIONS
          if ($key == 'PRIORITY'){
            $this->container = ''; // Blank, Flate Rate Envelope, or Flat Rate Box // Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box

          }
21 Jan 2011, 4:56 PM
#3
knottybynature avatar

knottybynature

New Zenner

Join Date:
Jul 2007
Location:
Western New York
Posts:
48
Plugin Contributions:
0

Re: USPS Flat Rate not an option

Linda, what if I am using Zen Cart 1.3.8a? I can't find that string of wording & I don't want to insert it in the wrong place/where it won't list the rates.

Thanks!

21 Jan 2011, 5:06 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: USPS Flat Rate not an option

The valid USPS shipping module for January 2, 2011 C, regardless of your Zen Cart version, is on post #26 on this thread:
http://www.zen-cart.com/forum/showthread.php?p=978059#post978059

You can look in the file for the code ...

30 Jan 2011, 11:04 PM
#5
knottybynature avatar

knottybynature

New Zenner

Join Date:
Jul 2007
Location:
Western New York
Posts:
48
Plugin Contributions:
0

Re: USPS Flat Rate not an option

Sigh...got the new module to load, only to find out it only expands the international priority flat rate options. i am looking for domestic only...the changes i made did not work. what could i be doing wrong?:unsure:

31 Jan 2011, 12:25 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: USPS Flat Rate not an option

What is it that you are wanting the USPS module to do for Domestic? :unsure:

3 Feb 2011, 10:17 AM
#7
majolsurf avatar

majolsurf

New Zenner

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

Re: USPS Flat Rate not an option

Hi Ajeh,

I'm not getting USPS Flat Rate quotes either. I don't know php, but tried the following code. It doesn't work, it only selects the Small Box Rate. I can get the 'else' statement to assign the shipping rate to Large Flat Rate Box if I change < to >. I'm thinking $usps_shipping_weight is close to zero?

//PRIORITY MAIL OPTIONS
if ($key == 'PRIORITY')
{
if ($usps_shipping_weight < 5)
{
$this->container = 'Sm Flat Rate Box';
}
else if ($usps_shipping_weight < 10)
{
$this->container = 'Md Flat Rate Box';
}
else
{
$this->container = 'Lg Flat Rate Box';
}
}

What can I change in the script to implement Flat Rate Shipping? I did install the updated usps.php but only get flat rate quotes for international shipping.

3 Feb 2011, 2:36 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: USPS Flat Rate not an option

The variable $usps_shipping_weight is not defined at that point ...

Add above your IF statement:

global $shipping_weight;

Then, change all of the $usps_shipping_weight to $shipping_weight ... see if that works better for you ...

3 Feb 2011, 7:31 PM
#9
majolsurf avatar

majolsurf

New Zenner

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

Re: USPS Flat Rate not an option

That did it! Thank you so much! :laugh:

3 Feb 2011, 7:41 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: USPS Flat Rate not an option

Thanks for the update that you were able to fix this by using the correct weight variable ... :smile:

16 Feb 2011, 3:44 PM
#11
codinglama avatar

codinglama

New Zenner

Join Date:
Aug 2010
Posts:
1
Plugin Contributions:
0

Re: USPS Flat Rate not an option

Ajeh:

The variable $usps_shipping_weight is not defined at that point ...

Add above your IF statement:

global $shipping_weight;

> 
> Then, change all of the $usps_shipping_weight to $shipping_weight ... see if that works better for you ...

Instead of bringing in the global variable, you could use:

$this->pounds

in your conditionals instead.
12 Mar 2011, 8:26 PM
#12
page avatar

page

New Zenner

Join Date:
Jan 2011
Location:
Atlanta, GA The A-Town Down
Posts:
23
Plugin Contributions:
0

Re: USPS Flat Rate not an option

I want to enable USPS Priority Flat Rate Shipping for some items (Domestic only for now).
I went to /includes/modules/shipping/usps.php. It is 15 pages!

!. What line do I put it in?
2. Is this the correct php language?

global $shipping_weight;
//PRIORITY MAIL OPTIONS
if ($key == 'PRIORITY'){
$this->container = ''; // Blank, Flate Rate Envelope, or Flat Rate Box // Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box

      }

//PRIORITY MAIL OPTIONS
if ($key == 'PRIORITY')
{
if ($usps_shipping_weight < 5)
{
$this->container = 'Sm Flat Rate Box';
}
else if ($usps_shipping_weight < 10)
{
$this->container = 'Md Flat Rate Box';
}
else
{
$this->container = 'Lg Flat Rate Box';
}
}