Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / UPS Module - Free ground but charge for express?

UPS Module - Free ground but charge for express?

Views: 1,318

Results 1 to 9 of 9
12 Jan 2013, 2:39 PM
#1
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

UPS Module - Free ground but charge for express?

Over years of experience, the UPS module seems to work the best overall with Google Wallet and PayPal, etc. Using just the free shipping option in the edit product page throws up an invalid argument error on PayPal orders. Is there a way to offer free ground shipping and only use the UPS rates for 2nd day and next day?

12 Jan 2013, 2:43 PM
#2
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: UPS Module - Free ground but charge for express?

PS: I know that invalid argument error was probably resolved in newer versions. But still was wondering if possible to offer free ground within the UPS module somehow. Thanks!

14 Jan 2013, 9:53 AM
#3
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: UPS Module - Free ground but charge for express?

Since it doesn't look like there is a way to hack the UPS module itself to output $0.00 for Ground (if there is a way please let me know), so as an alternative I enabled the free option and renamed it to UPS Ground. Then changed the UPS to only display prices for 2nd Day and Next Day.

BUT now it always shows the free shipping before the customer puts their zip code in for a quote. This isn't ideal because they will think there is only one option and not know they can upgrade shipping. How to hide the free quote until they put a zip code like the other modules?

14 Jan 2013, 2:56 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: UPS Module - Free ground but charge for express?

You can customize the UPS shipping module around line 189 with the code in RED:

        $cost = preg_replace('/[^0-9.]/', '',  $cost);
[B]// bof: Set Ground to 0.00
        if ($type == 'GND') {
          $cost = 0.00;
        }
// eof: Set Ground to 0.00
[/B]        $methods[] = array('id' => $type,
                           'title' => $this->types[$type],
                           'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_UPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_UPS_HANDLING) );
15 Jan 2013, 4:44 AM
#5
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: UPS Module - Free ground but charge for express?

Ajeh:

You can customize the UPS shipping module around line 189 with the code in RED:

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

[B]// bof: Set Ground to 0.00
if ($type == 'GND') {
$cost = 0.00;
}
// eof: Set Ground to 0.00
[/B]
$methods[] = array('id' => $type,
'title' => $this->types[$type],
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_UPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_UPS_HANDLING) );


Ajeh you never fail to come through with all the answers. Thank you!!!!!!!
15 Jan 2013, 3:13 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: UPS Module - Free ground but charge for express?

You are most welcome ... thanks for the update that this works for you on the Free Ground for UPS ... :smile:

16 Jan 2013, 4:00 PM
#7
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: UPS Module - Free ground but charge for express?

It definitely seems to work. Mind you, it's an old version, but working nonetheless.

It was line 172 and had the following code:

        list($type, $cost) = each($upsQuote[$i]);
        // BOF: UPS USPS
        if ($type=='STD') {
          if ($std_rcd) continue;
          else $std_rcd = true;
        }
        if (!in_array($type, $allowed_methods)) continue;

Changed to this as you said:

        list($type, $cost) = each($upsQuote[$i]);
        // BOF: UPS USPS
        if ($type == 'GND') {
          $cost = 0.00;
        }
        if (!in_array($type, $allowed_methods)) continue;

When adding a handling fee of say $5.00 only the handling fee is charged. I supposed it would be extra complicated to remove the handling fee as well.

16 Jan 2013, 4:09 PM
#8
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: UPS Module - Free ground but charge for express?

Forgot to add that I hope it's ok to make the edits I made.

16 Jan 2013, 4:14 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: UPS Module - Free ground but charge for express?

To also manage the handling, then try this code:

// bof: Set Ground to 0.00 and Handling to ground
        if ($type == 'GND') {
          $cost = 0.00;
        }
        $methods[] = array('id' => $type,
                           'title' => $this->types[$type],
                           'cost' => ($cost * $shipping_num_boxes) + ($type == 'GND' ? 0.00 : (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_UPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_UPS_HANDLING)) );
// eof: Set Ground to 0.00 and Handling to ground