Latest News: (loading..)

Adding a Fee to sub total

6 posts in this topic

Hello Everyone,


I wish to be able to add a credit card "convenience" fee of 2% to the sub total of all orders made on my site, I do not know how to accomplish this. The reason why I wish to do this is because of the credit card fees I receive from my merchant account at If there is any other information that you need to help point me in the right direction, please let me know.


Thank You

Share this post

Link to post
Share on other sites

Use Payment Type Charge for that.









Will this addon work for oscommerce 2.3.x, or are there any similar addons available for 2.3.x? Would I be better off coding a new one?

Share this post

Link to post
Share on other sites

I am trying to add the cost of each payment option on checkout_payment.php in osCommerce 2.3.4, but with the solution given in the v2.2 version of this addon, but some reason (although the code makes sense), no price is retrieved.


code used:

If you want to display the payment fee in the checkout page, add this code :

# go to catalog/includes/classes/payment.php
# REPLACE the function selection() around line 125 with the one below: (or ADD the //added for ot_fixed_payment_chg" lines)
  function selection() {
      $selection_array = array();
      include_once (DIR_WS_MODULES.'order_total/ot_fixed_payment_chg.php'); // added for ot_fixed_payment_chg
      $pay_chg = new ot_fixed_payment_chg; // added for ot_fixed_payment_chg
      if (is_array($this->modules)) {
        while (list(, $value) = each($this->modules)) {
          $class = substr($value, 0, strrpos($value, '.'));
          if ($GLOBALS[$class]->enabled) {
            $selection = $GLOBALS[$class]->selection();
            $selection['cost'] = $pay_chg->get_payment_cost($class); // added for ot_fixed_payment_chg
            if (is_array($selection)) $selection_array[] = $selection;
      return $selection_array;

# go to catalog/checkout_payment.php  
# find this line (around 257)
                    <td class="main" colspan="3"><b><?php echo $selection[$i]['module']; ?></b></td>

# REPLACE with:
                    <td class="main" colspan="3"><b>
                          echo $selection[$i]['module'];
                          if ($selection[$i]['cost']){
                            echo ' ('.$currencies->format($selection[$i]['cost']).')'; 

Any help would be appreciated :)

Edited by swcharlie

Share this post

Link to post
Share on other sites

i got it to work....


first i go to


click show more downloads and take the top one


then i go to


and do the same


i first copy over the files from the last one, then over write them with the files from the first one... 


at the confirm i now have an amount but still need to mod the files so it shows up at payment method selection

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now