Expedite Fee in osCommerce

By | December 14, 2009

So, you might want to charge an extra amount for shipping “expedited” – especially in the run up to Christmas. At the osCommerce forum someone asked for such, and a number of ideas came up. There are some close contributions, eg “gift wrap” (renamed appropriately of course).

My idea was to simply make a copy of the “low order fee” order_total module, and use that. I guesstimated that it would take 10 extra lines of code, so let’s see…

What do we need to do?

1. Add in a checkbox on checkout_shipping.php

[php] format(MODULE_ORDER_TOTAL_EXPEDITEFEE_FEE)); ?>[/php]

2. Add in processing on checkout_shipping.php

[php]if(!empty($HTTP_POST_VARS[‘expedite_fee’])) tep_session_register(‘expedite_fee’);[/php]

3. Destroy the session in checkout_process.php

[php]tep_session_unregister(‘expedite_fee’);[/php]

4. Copy /includes/modules/order_total/ot_loworderfee.php

Open up the file and change ALL instances of “loworderfee” to “expeditefee”
Also change ALL instances of “LOWORDERFEE” to “EXPEDITEFEE”
Also change all instances of “low order” or “Low Order” to “Expedite”

Change this line from:
[php]if ( ($pass == true) && ( ($order->info[‘total’] – $order->info[‘shipping_cost’]) < MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER) ) {[/php] To: [php]if (($pass == true) && (tep_session_is_registered('expedite_fee'))){[/php] Save the file as expeditefee.php 5. Copy the Language File /includes/languages/english/modules/order_total/ot_loworderfee.php

Open up the file and change ALL instances of “loworderfee” to “expeditefee”
Also change ALL instances of “LOWORDERFEE” to “EXPEDITEFEE”
Also change all instances of “low order” or “Low Order” to “Expedite”

Save the file as expeditefee.php

6. Language addition in /includes/languages/english/checkout_shipping.php
Add this:
[php]define(‘TEXT_EXPEDITE’, ‘Tick this box to expedite your order, costs an extra %s’);[/php]

7. Admin

Go to your shop admin and turn on the new order total module. Give it a unique sort order and make it show underneath the usual shipping charges.

DONE! This took 10 minutes, and consisted of mainly copy/paste code changes of words, along with three new lines of code (obviously I don’t count a simple word change in an existing lline of code as something that is new.

7 thoughts on “Expedite Fee in osCommerce

  1. Gary Post author

    Now have a different version of this on a per shipping module basis, rather than on an overall basis. Thus you might want to charge an extra £5 for expediting flat rate, but only an extra $3 for expediting Table rate. Contact me for costings/details.

  2. Pingback: Club osCommerce » Expedite Fee Per Shipping Method

  3. zegar

    hi, i followed all steps, but it is not showing in shipping modules, also i am not even getting
    any error after adding all this, please advise

  4. Alex

    Add in a checkbox on checkout_shipping.php

    where in this page would this insert be placed?

  5. Gary Post author

    Anywhere you wish – where-ever it fits best in your theme/template code.

  6. Geeks Market

    Supercool! Just added your hack on my site. If it bring some extramoney, I swear to buy you beer! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *