Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding a Fee to sub total


spry

Recommended Posts

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 Authorize.net. If there is any other information that you need to help point me in the right direction, please let me know.

 

Thank You

Link to comment
Share on other sites

  • 2 years later...

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)) {
        reset($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>
                      <?php 
                          echo $selection[$i]['module'];
                          if ($selection[$i]['cost']){
                            echo ' ('.$currencies->format($selection[$i]['cost']).')'; 
                          }
                      ?></b></td>

Any help would be appreciated :)

Edited by swcharlie
Link to comment
Share on other sites

  • 1 year later...

i got it to work....

 

first i go to http://addons.oscommerce.com/info/251

 

click show more downloads and take the top one

 

then i go to http://addons.oscommerce.com/info/7996

 

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

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.

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...