Zen Cart Logo
Forums / Addon Shipping Modules / UPSXML - minimum shipping charge

UPSXML - minimum shipping charge

Views: 1,610

Results 1 to 5 of 5
5 Jan 2011, 5:13 PM
#1
gwolanin avatar

gwolanin

New Zenner

Join Date:
Dec 2010
Posts:
6
Plugin Contributions:
0

UPSXML - minimum shipping charge

I searched for this and could not find what I was looking for. Besides me going in and modifying the code myself, I was hoping that there is an option somewhere in UPSXML shipping module.

I want to have a minimum shipping charge of $X.00. Is this possible with the UPSXML module? I could not find it anywhere.

I currently do add a % for the handling fee but it isn't enough to cover my basic costs.

Thanks in advance.

I have the latest Zen Cart installed and UPSXML.

5 Jan 2011, 5:27 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: UPSXML - minimum shipping charge

You would need to customize the code to handling minimum charges if using a Handling Fee cannot manage the prices correctly for you ...

5 Jan 2011, 6:34 PM
#3
gwolanin avatar

gwolanin

New Zenner

Join Date:
Dec 2010
Posts:
6
Plugin Contributions:
0

Re: UPSXML - minimum shipping charge

I made this more difficult than it should have been

added this in includes/modules/shipping/upsxml.php

// change the 8.00 to whatever MINIMUM charge you want for the UPS Shipping Fee
$cost = ( ( $cost < 8.00 ) ? 8.00 : $cost );

right before

$methods[] = array('id' => $type, 'title' => $_type, 'cost' => ($this->handling_fee + $cost));
5 Jan 2011, 8:27 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: UPSXML - minimum shipping charge

Thanks for the update on what method worked for you ... :smile:

12 Jan 2011, 8:33 PM
#5
gwolanin avatar

gwolanin

New Zenner

Join Date:
Dec 2010
Posts:
6
Plugin Contributions:
0

Re: UPSXML - minimum shipping charge

I experienced another issue with the flat rate fee that my customer wanted.

The customer wanted a minimum of $8.00 for shipping, but anything greater than $8.00 add a 20% handling fee.

I had a difficult time getting the UPSXML module to calculate a 20% handling fee. I saw some instructions that stated to use 20.0 for a % but that was just adding $20.00 to the shipping cost.

Here is what I did.

// change the 8.00 to whatever MINIMUM charge you want for the UPS Shipping Fee

$oldHandlingFee = $this->handling_fee;

$cost = ($cost < 8.00 ? 8.00 : $cost);

//print "BEFORE | $type, Shipping Cost = $cost, Handling Fee = $handlingFee, " . $this->handling_fee . "<br />";

if( strstr( $this->handling_fee, "%" ) ) {
	$isPercent = 1;
} else {
	$isPercent = 0;
}

if( $isPercent ) {
	if( floatval($cost) <= 8.00 ) {
		$handlingFee = 0;
		$this->handling_fee = $handlingFee;
	} else {
		$handlingFee = ( $cost * ( floatval( $this->handling_fee ) / 100 ) );
		$this->handling_fee = $handlingFee;
	}
}

// debugging
//print "AFTER | $type, Shipping Cost = $cost, Handling Fee = $handlingFee, " . $this->handling_fee . "<br />";


                $methods[] = array('id' => $type, 'title' => $_type, 'cost' => ($this->handling_fee + $cost));

// set the handling fee back to its original value to calc the rest of the shipping handling fees
$this->handling_fee = $oldHandlingFee;

What I did was put 20% in the handling fee field when in Admin->Modules->Shipping->UPSXML

It now works beautifully.