Jump to content



Photo
- - - - -

Adding a Fee to sub total


  • Please log in to reply
4 replies to this topic

#1   spry

spry
  • Members
  • 5 posts
  • Real Name:spry

Posted 27 July 2011 - 23:28

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

#2   DunWeb

DunWeb

    The Censored One

  • Members
  • 13,084 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 28 July 2011 - 00:10

Use Payment Type Charge for that.




Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

#3   swcharlie

swcharlie
  • Members
  • 24 posts
  • Real Name:Schalk
  • Gender:Male

Posted 06 July 2014 - 11:00

Use Payment Type Charge for that.




Chris

 

Hi

 

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?



#4   swcharlie

swcharlie
  • Members
  • 24 posts
  • Real Name:Schalk
  • Gender:Male

Posted 06 July 2014 - 11:03

Hi

 

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?

 

Just found:

http://addons.oscommerce.com/info/7996

 

Will try this out :)



#5   swcharlie

swcharlie
  • Members
  • 24 posts
  • Real Name:Schalk
  • Gender:Male

Posted 06 July 2014 - 21:29

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 '&nbsp;('.$currencies->format($selection[$i]['cost']).')'; 
                          }
                      ?></b></td>

Any help would be appreciated :)


Edited by swcharlie, 06 July 2014 - 21:30.