Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Handling Fee as Percentage?

Handling Fee as Percentage?

Views: 22,077

Results 21 to 40 of 52
13 May 2011, 4:51 AM
#21
ajeh avatar

ajeh

Oba-san

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

Handling Fee as Percentage?

There is a Handling fee on USPS ... what version of Zen Cart are you using? :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 May 2011, 4:34 PM
#22
sparrowce avatar

sparrowce

Zen Follower

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

Re: Handling Fee as Percentage?

Regarding the solution in #17, is this percentage added to the order total or calculated shipping cost of order based on weight? Am needing to do similar and want to confirm it is based on the shipping amount vs the entire order. Thank you for any info.

22 May 2011, 7:13 PM
#23
sparrowce avatar

sparrowce

Zen Follower

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

Re: Handling Fee as Percentage?

Thank you for posting your solution, it works nicely. For info my question about what the percent is calculated on, it appears to be order total.

2 Jun 2011, 1:55 PM
#24
thinkagi avatar

thinkagi

New Zenner

Join Date:
Jun 2011
Location:
Syracuse, NY
Posts:
1
Plugin Contributions:
0

Re: Handling Fee as Percentage?

Hello:

I hate to keep this thread going, but based on the title, I think it applies to my dilemma. I am using the latest version of Zen Cart, and I am looking to apply a percentage-based handling fee to my shipping. I am using a priced-based table rate and would like to add a 5% handling fee based on total cost after taxes. I know from reading the other posts as well as other threads where to find the module's php, but am confused on how I would be able to change the formula to multiply by the handling fee instead of adding the fee.

Please help! Thanks!

18 Feb 2012, 10:12 PM
#25
ec_web avatar

ec_web

New Zenner

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

Re: Handling Fee as Percentage?

Donanater:

Well I figured it out:clap:

The finished result was two fold. For our Free Shipping we added a 3% charge for PayPal transactions and $2.75 handling charge to cover shipping overhead. For our USPS module (priority, express, international shipping and PayPal charges we added a 5% charge plus $1.70.

No need to have an additional "Handling Fee" on the Shipping Module, this formula by-passes that.

USPS Shipping:
/public_html/includes/modules/shipping/usps.php

insert " +($order->info['subtotal'] * .05 + 1.70) into Line 298
where ($order->info['subtotal'] is your subtotal price * percent + overhead shipping cost.

Orginal:
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );

Updated:
'cost' => ($cost * $shipping_num_boxes) + ($order->info['subtotal'] * .05 + 1.70) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );

Free Shipping:
/public_html/includes/modules/shipping/freeoptions.php

insert "($order->info['subtotal'] * .03 + 2.75) +"
where ($order->info['subtotal'] is your subtotal price * percent + overhead shipping cost.

Orginal:
'cost' => MODULE_SHIPPING_FREEOPTIONS_COST + MODULE_SHIPPING_FREEOPTIONS_HANDLING)));

Updated:
'cost' => MODULE_SHIPPING_FREEOPTIONS_COST + ($order->info['subtotal'] * .03 + 2.75) + MODULE_SHIPPING_FREEOPTIONS_HANDLING)));

Hope this helps anyone else out there.

Ok, this worked on the old version, but it doesn't seem to work on the January 2012 update. Anyone know what I might need to do different or what I'm doing wrong? I'm using .03 + 1.75 for the USPS module.

website: http://earthscauldron.com/store/

18 Feb 2012, 11:15 PM
#26
ajeh avatar

ajeh

Oba-san

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

Re: Handling Fee as Percentage?

Add this line in RED to the code and see what is being calculated:

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

// add $this->usps_countries to title to test actual country
echo 'I See USPS Cost: ' . $cost . ' Extra: ' . ($order->info['subtotal'] * .03 + 1.75) . ' = ' . (($order->info['subtotal'] * .03 + 1.75) + $cost) . '<br>';

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Feb 2012, 12:26 AM
#27
ec_web avatar

ec_web

New Zenner

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

Re: Handling Fee as Percentage?

ya, shows it's only adding 1.75 and not the 3%

19 Feb 2012, 12:40 AM
#28
ajeh avatar

ajeh

Oba-san

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

Re: Handling Fee as Percentage?

Could you paste what you see from the echo?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Feb 2012, 12:47 AM
#29
ec_web avatar

ec_web

New Zenner

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

Re: Handling Fee as Percentage?

I See USPS Cost: 31.25 Extra: 1.75 = 33
I See USPS Cost: 5.65 Extra: 1.75 = 7.4
I See USPS Cost: 5.55 Extra: 1.75 = 7.3

Estimate Shipping Costs
Total Items: 1 Amount: $140.00
Country: Please Choose Your Country United States Australia Canada United Kingdom United States Minor Outlying Islands
State/Province: Please select ...AlabamaAlaskaAllAmerican SamoaArizonaArkansasArmed Forces AfricaArmed Forces AmericasArmed Forces CanadaArmed Forces EuropeArmed Forces Middle EastArmed Forces PacificCaliforniaColoradoConnecticutDelawareDistrict of ColumbiaFederated States Of MicronesiaFloridaGeorgiaGuamHawaiiIdahoIllinoisIndianaInternationalIowaKansasKentuckyLouisianaMaineMarshall IslandsMarylandMassachusettsMichiganMinnesotaMississippiMissouriMontanaNebraskaNevadaNew HampshireNew JerseyNew MexicoNew YorkNorth CarolinaNorth DakotaNorthern Mariana IslandsOhioOklahomaOregonPennsylvaniaPuerto RicoRhode IslandSouth CarolinaSouth DakotaTennesseeTexasUtahVermontVirgin IslandsVirginiaWashingtonWest VirginiaWisconsinWyoming

Post/Zip Code:

Shipping quotes are based on the address information you selected:
Maine 04101 United States
Available Shipping Methods Rates
Store Pickup (Walk In) $0.00
United States Postal Service (Parcel Post (4 - 7 days)) $7.30
United States Postal Service (Priority Mail (2 - 3 days)) $7.40
United States Postal Service (Express Mail (1 - 2 days)) $33.00
United Parcel Service (1.00lbs) (Ground) $12.92

[ Close Window ]

19 Feb 2012, 12:53 AM
#30
ajeh avatar

ajeh

Oba-san

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

Re: Handling Fee as Percentage?

And you are using:

          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost * $shipping_num_boxes) + ($order->info['subtotal'] * .03 + 1.75) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? $usps_handling_fee * $shipping_num_boxes : $usps_handling_fee) );

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Feb 2012, 12:56 AM
#31
ec_web avatar

ec_web

New Zenner

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

Re: Handling Fee as Percentage?

Ya, this:

$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost * $shipping_num_boxes)+($order->info['subtotal'] * .03 + 1.75) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? $usps_handling_fee * $shipping_num_boxes : $usps_handling_fee) );

19 Feb 2012, 1:01 AM
#32
ajeh avatar

ajeh

Oba-san

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

Re: Handling Fee as Percentage?

Could you go to your Admin and look in Modules ... Order Total ... and click on Subtotal ot_subtotal and make sure it is installed ...

Also change your echo in the USPS shipping module to:

echo 'I See USPS type: ' . $type . ' order subtotal: ' . $order->info['subtotal'] . ' Cost: ' . $cost . ' Extra: ' . ($order->info['subtotal'] * .03 + 1.75) . ' = ' . (($order->info['subtotal'] * .03 + 1.75) + $cost) . '<br>';

what comes up?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Feb 2012, 1:06 AM
#33
ec_web avatar

ec_web

New Zenner

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

Re: Handling Fee as Percentage?

Ya installed:

Order Sub-Total

This module is installed
true

Sort Order
100


Ok changed echo:

I See USPS type: EXPRESS order subtotal: Cost: 31.25 Extra: 1.75 = 33
I See USPS type: PRIORITY order subtotal: Cost: 5.65 Extra: 1.75 = 7.4
I See USPS type: PARCEL order subtotal: Cost: 5.55 Extra: 1.75 = 7.3

Estimate Shipping Costs
Total Items: 1 Amount: $140.00
Country: Please Choose Your Country United States Australia Canada United Kingdom United States Minor Outlying Islands
State/Province: Please select ...AlabamaAlaskaAllAmerican SamoaArizonaArkansasArmed Forces AfricaArmed Forces AmericasArmed Forces CanadaArmed Forces EuropeArmed Forces Middle EastArmed Forces PacificCaliforniaColoradoConnecticutDelawareDistrict of ColumbiaFederated States Of MicronesiaFloridaGeorgiaGuamHawaiiIdahoIllinoisIndianaInternationalIowaKansasKentuckyLouisianaMaineMarshall IslandsMarylandMassachusettsMichiganMinnesotaMississippiMissouriMontanaNebraskaNevadaNew HampshireNew JerseyNew MexicoNew YorkNorth CarolinaNorth DakotaNorthern Mariana IslandsOhioOklahomaOregonPennsylvaniaPuerto RicoRhode IslandSouth CarolinaSouth DakotaTennesseeTexasUtahVermontVirgin IslandsVirginiaWashingtonWest VirginiaWisconsinWyoming

Post/Zip Code:

Shipping quotes are based on the address information you selected:
Maine 04101 United States
Available Shipping Methods Rates
Store Pickup (Walk In) $0.00
United States Postal Service (Parcel Post (4 - 7 days)) $7.30
United States Postal Service (Priority Mail (2 - 3 days)) $7.40
United States Postal Service (Express Mail (1 - 2 days)) $33.00
United Parcel Service (1.00lbs) (Ground) $12.92

[ Close Window ]

19 Feb 2012, 1:22 AM
#34
ajeh avatar

ajeh

Oba-san

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

Re: Handling Fee as Percentage?

It does not make a lot of sense ...

What version of Zen Cart are you using?

Clean install or an upgrade?

If you switch to the Classic template does it work in the shipping estimator?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Feb 2012, 1:29 AM
#35
ec_web avatar

ec_web

New Zenner

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

Re: Handling Fee as Percentage?

Ok, this is weird, if I log in with my testing customer info two different ids both in FL and NY it shows the 1.75 plus 3%, if I'm not logged in it only shows the 1.75....wha??

I'm using version 1.3.9h clean install, I'm using the classic template, I've just tweeked it to what I want.

19 Feb 2012, 1:33 AM
#36
ajeh avatar

ajeh

Oba-san

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

Re: Handling Fee as Percentage?

Well this makes it harder to debug ...

I have tried this code in my v1.3.9h and it works in both the shipping estimator whether I am logged in or not and the checkout ...

For giggles and grins, go to the Modules ... Shipping ... and click on USPS and EDIT it and save the settings to NotePad ... then, do a REMOVE, INSTALL and reconfigure it ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Feb 2012, 1:41 AM
#37
ec_web avatar

ec_web

New Zenner

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

Re: Handling Fee as Percentage?

Ok, removed, re-installed, no change....

Could something here be the problem:

Enable USPS Shipping
True

Enter the USPS Web Tools User ID


Which server to use
production

Quote Sort Order
Price

Handling Fee - US
0

Handling Fee - International
0

Handling Per Order or Per Box
Order

Decimal Settings
3

Tax Class
--none--

Tax Basis
Shipping

Shipping Zone
--none--

Sort Order
1

All Packages are Machinable
True

USPS Options
Display transit time

Domestic Shipping Methods
EXPRESS, PRIORITY, FIRST CLASS, PARCEL

International Shipping Methods
Global Express, Priority Mail International, First Class Mail Int Parcel

Debug Mode
Off

19 Feb 2012, 1:46 AM
#38
ajeh avatar

ajeh

Oba-san

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

Re: Handling Fee as Percentage?

So far nothing is indicating the problem ...

If you look at the usps.php file, and find the line that starts as:

  function quote($method = '') {

what are the next 2 lines?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Feb 2012, 1:54 AM
#39
ec_web avatar

ec_web

New Zenner

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

Re: Handling Fee as Percentage?

function quote($method = '') {
    // BOF: UPS USPS
    global $order, $shipping_weight, $shipping_num_boxes, $transittime;
19 Feb 2012, 2:03 AM
#40
ajeh avatar

ajeh

Oba-san

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

Re: Handling Fee as Percentage?

I am not finding a reason for this issue ...

Without going through your site and checking all of the files, I am not sure what the reason is ...

You can hide the problem by turning off the shipping estimator or you can see if you can find someone to pursue this further and try to hunt down the problem ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!