6 replies [Last post]
modulist's picture
Offline
Joined: 08/29/2008
Juice: 3
Was this information Helpful?

How should on handle fees -- like registration fees, transaction fees, uniform fees, handling fees, etc. -- that should be added to the shopping cart separately from the purchased items?

The merchant in this case is very clear about wanting to keep the the required fees separate from the purchased item itself.

To make things more interesting, on a few of our projects we need to have one or both of the following:

1) a transaction fee for the entire purchase

2) a registration fee for each person being registered for a course by a parent.

Any suggestions?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Required fees that are automatically added to cart

This is a common problem a lot of people face, but as of yet no development has been done for a generic fee module. In theory this could be combined with a discount module, but the discount contribution has not been updated for some time. If it still works with the latest UC, I remember folks using it for fees in the past.

Bartezz's picture
Offline
Joined: 04/18/2008
Juice: 104
Re: Re: Required fees that are automatically added to cart

I've followed your advice and looked at applying handling fees with uc_discount.module.
I know it's bad practice but I hacked the module a bit to make it work;

I'm using uc_discounts.module // $Id: uc_discounts.module,v 1.1 2008/10/20 17:05:20 psynaptic Exp $ for this;

// line #348
// if ($discount['amount'] > 0) {
// comment above and insert line below to make negative discounts possible
if ($discount['amount']) {

// line #349-#352
// $rows[] = array(
//    $discount['description'],
//    array('data' => uc_currency_format($discount['amount']), 'class' => 'text-right'),
// );
// I add a plus or minus sign to the 'discount' (or surcharge) amount; - for discount and + for surcharge
$plusminus = (substr($discount['amount'], 0, 1) == "-" ? "+ " : "- ");
$rows[] = array(
$discount['description'],
array('data' => $plusminus.uc_currency_format(ereg_replace("[^0-9\.]","",$discount['amount'])), 'class' => 'text-right'),
);

// line #378-#385
//foreach ($apply_discounts as $discount) {
// $output .= '<tr>';
// $output .= '<td>'. $discount['description'] .'</td>';
// $output .= '<td class="text-right">'. uc_currency_format($discount['amount']) .'</td>';
// $output .= '</tr>';
// // store as negative
// $discount_total -= $discount['amount'];
//}
foreach ($apply_discounts as $discount) {
$output .= '<tr>';
$output .= '<td>'. $discount['description'] .'</td>';
$plusminus = (substr($discount['amount'], 0, 1) == "-" ? "+ " : "- ");
$output .= '<td class="text-right">'. $plusminus.uc_currency_format(ereg_replace("[^0-9\.]","",$discount['amount'])) .'</td>';
$output .= '</tr>';
// store as negative
$discount_total -= $discount['amount'];
}

Now what you can do is also change strings like t('Discounts') to t('Discounts & surcharges')

Then in admin/store/discounts;

- you add a new discount, name it 'Handling fee'
- give it a description (I know call all my discounts 'blah blah discount' and all my surcharges/fees 'blah blah surcharge'
- Max discounts: 1
- Weight, Start/end date to your likings
- Active: duh ofcourse Sticking out tongue
- Save
- Add condition -> property: Order total (this assumes you have this helper module enabled)
- Next
- Comparison operator: >
- Amount: 0.01 (you need to order for at least 1 cent to be charged this handling fee)
- Save
- Add action: Discount amount from order total
- Next
- Amount: -5 (make sure this is a negative number/discount so it'll actually be added to the total)

And you're all set Smiling

Hope this helps others!

Regards

mrfelton's picture
Offline
Joined: 10/03/2008
Juice: 31
Re: Re: Re: Required fees that are automatically added to cart

Wrote this last night.
It's not finished, but it's certainly a good start.

http://drupal.org/project/uc_fee

Tom Kirkpatrick - kirkdesigns.co.uk

soapcrafters's picture
Offline
Joined: 09/17/2008
Juice: 58
I have the same problem. I

I have the same problem.
I need to add a handling fee to each order, not each product.
If I raise the shipping cost the $2 then people will freak out. They don't seem to mind a separate $2 handling fee though.
I don't see any way to charge this, or the optional $5 rush fee.

jlaster's picture
Offline
Joined: 03/08/2009
Juice: 22
Handling Fee

Hi,
If you use USPS as shipping method you can add a handling fee under Markup type:.
Haven't tried yet other shipping methods.

rickster's picture
Offline
Joined: 03/01/2010
Juice: 65
this doesn't work for me, and can't get feedback either

I wish Markup thing in usps worked.

I have usps set up and I see where I can choose addition, percentage or multplier, I've chosen addition and added $2.00. When I tested this, it added a lot more than $2.00. so something's wrong.
any help you could give I'd greatly appreciate. I've been looking for a while and not many people are addressing it.

thanks.

rick