Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Free Shipping for ONLY USPS 1st class or Priority Main

Free Shipping for ONLY USPS 1st class or Priority Main

Locked

Views: 2,795

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
19 Oct 2009, 3:12 PM
#1
rubic07 avatar

rubic07

New Zenner

Join Date:
Oct 2009
Posts:
5
Plugin Contributions:
0

Free Shipping for ONLY USPS 1st class or Priority Main

Hi,
I have two questions on shipping.

  1. I would only like to apply Free Shipping to USPS 1st class or Priority Mail, not International or UPS. Is this possible and how?

  2. Is it possible to add a 2nd Promo Code box so a customer can enter two separate codes? (ie one for 10% off and free shipping). This would be because currently Zen Cart doesn't allow a combination of a discount AND free shipping.

Thank you!

20 Oct 2009, 5:10 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping for ONLY USPS 1st class or Priority Main

Discount Coupons are for either an Amount, a Percentage or Free Shipping but not for a combination of these ...

On the USPS shipping module you could alter the code to:

          if ($type == 'PRIORITY') {
            $cost = 0.00;
          }
          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);

NOTE: if you use a Handling charge that is still being added in unless you customize this further ...

20 Oct 2009, 12:02 PM
#3
rubic07 avatar

rubic07

New Zenner

Join Date:
Oct 2009
Posts:
5
Plugin Contributions:
0

Re: Free Shipping for ONLY USPS 1st class or Priority Main

Thank you. Can you please be more specific on where this file is located and where exactly in the PHP file to change the code?

20 Oct 2009, 1:15 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping for ONLY USPS 1st class or Priority Main

All shipping modules are located in:
/includes/modules/shipping

and their language files are in:
/includes/languages/english/modules/shipping

You can use templates and overrides for the Language file, if needed:
/includes/languages/english/modules/shipping/your_template_dir

20 Oct 2009, 1:40 PM
#5
rubic07 avatar

rubic07

New Zenner

Join Date:
Oct 2009
Posts:
5
Plugin Contributions:
0

Re: Free Shipping for ONLY USPS 1st class or Priority Main

Thanks! I was able to find the file "usps.php", but still not sure where exactly to put this code in the "usps.php" file:

 if ($type == 'PRIORITY') {
            $cost = 0.00;
          }
          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
20 Oct 2009, 3:10 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping for ONLY USPS 1st class or Priority Main

The original code is:

          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);

Change it to:

          if ($type == 'PRIORITY') {
            $cost = 0.00;
          }
          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);

The code in RED is the new code to set the shipping cost to $0.00 when the shipping method is Priority ...

20 Oct 2009, 3:31 PM
#7
rubic07 avatar

rubic07

New Zenner

Join Date:
Oct 2009
Posts:
5
Plugin Contributions:
0

Re: Free Shipping for ONLY USPS 1st class or Priority Main

Thanks for your help!

One more question...I have created a coupon for Free Shipping. Is there a way to only have the coupon apply to USPS Priority Mail?

20 Oct 2009, 4:58 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping for ONLY USPS 1st class or Priority Main

You would have to do a lot of customization to make that happen ... you have to intercept the shipping method and reset when the coupon is set to reset the shipping to that method ...