Expedite Fee in osCommerce
Buy Gary A Beer?
Buying me a "beer" helps me to keep my contributions updated and keep this blog alive - and you get a link from my homepage to your site. Cheers!
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
2. Add in processing on checkout_shipping.php
3. Destroy the session in checkout_process.php
-
tep_session_unregister('expedite_fee');
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:
-
if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) <MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER) ) {
To:
-
if (($pass == true) && (tep_session_is_registered('expedite_fee'))){
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:
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.



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.
Comment by Gary — April 1, 2010 @ 8:19 am
[...] while back I posted about a solution to add an expedite fee. It works well, but is available on a per checkout basis rather than on a per shipping method [...]
Pingback by Club osCommerce » Expedite Fee Per Shipping Method — April 13, 2010 @ 8:29 am
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
Comment by zegar — June 11, 2010 @ 5:06 pm
Add in a checkbox on checkout_shipping.php
where in this page would this insert be placed?
Comment by Alex — July 29, 2010 @ 3:49 pm
Anywhere you wish – where-ever it fits best in your theme/template code.
Comment by Gary — July 30, 2010 @ 8:49 am