Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

COD Fee ???


Just2Bad

Recommended Posts

Hi, is there a contribution somewhere that can add the fee of COD shipping to the customer order. Since it's costing 6$ here for a COD we need to charge it back but the defaul module in oscommerce doesn't have the option to add the fee

 

 

Thanks....

Link to comment
Share on other sites

You can take the "Payment Type Surcharge" contrib and make it work.

 

http://www.oscommerce.com/community/contributions,1306

 

I needed the same thing on my site and this works great. Takes just a little modification to work. Basically its setup to charge someone a % handling fee for Paypal. You just need to make the charge static $ amount which aint too hard. Then in admin define the charge to COD or whatever your cod module is named.

If someone uses COD as payment type they are charged the additional figure you have named. If you have trouble with the mod lmk with a PM and I will post my changes.

Link to comment
Share on other sites

  • 4 weeks later...

I have been asked how to make the surcharge a flat fee instead of a percentage.

 

change in your ot_surcharge.php

 

  function calculate_fee($amount) {
   global $order, $customer_id, $payment;
   $od_amount=0;
   $od_pc = $this->percentage + .35; //this is percentage plus the base fee
   $do = false;
   if ($amount > $this->minimum) {
   $table = split("[,]" , MODULE_PAYMENT_TYPE);
   for ($i = 0; $i < count($table); $i++) {
         if ($payment == $table[$i]) $do = true;
       }
   if ($do) {
// Calculate tax reduction if necessary
   if($this->calculate_tax == 'true') {
// Calculate main tax reduction
     $tod_amount = round($order->info['tax']*10)/10*$od_pc/100;
     $order->info['tax'] = $order->info['tax'] + $tod_amount;
// Calculate tax group deductions
     reset($order->info['tax_groups']);
     while (list($key, $value) = each($order->info['tax_groups'])) {
       $god_amount = round($value*10)/10*$od_pc/100;
       $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] + $god_amount;
     }  
   }
   //$od_amount = round($amount*10)/10*$od_pc/100;
   $od_amount = $this->percentage;
   $od_amount = $od_amount + $tod_amount;
   }
   }
   return $od_amount;
 }

 

you will see around line 68 I commented out

$od_amount = round($amount*10)/10*$od_pc/100;

and added after it

$od_amount = $this->percentage;

 

this seems to work great for me

Link to comment
Share on other sites

  • 6 months later...

this seems to work fine for adding a flat rate as opposed to a %

 

has anyone had any luck with actually getting it to work with the tax?

 

for some reason the tax screws up. It seems to be making its own numbers up

 

Andrew

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...