Post by zelda » Sun Jul 18, 2010 2:29 am

Hi,
I am wondering if it is possible to have a percentage of each sale for the handling fee?
Thank you

Active Member

Posts

Joined
Sat May 08, 2010 5:34 am

Post by i2Paq » Sun Jul 18, 2010 8:16 pm

There used to be one: [MOD] - Multi-Total Handling Fee (% or $), but it looks outdated.

Mayne this will do: Payment Type Fee Module

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by zelda » Mon Jul 19, 2010 3:13 am

i2Paq wrote:There used to be one: [MOD] - Multi-Total Handling Fee (% or $), but it looks outdated.

Mayne this will do: Payment Type Fee Module
Hey i2Paq,
thanks for the tip. the mod does look like it will work for 1.4.8 and I wonder if Q gives updates after you purchase the mod to keep up with the Opencart changes.

Active Member

Posts

Joined
Sat May 08, 2010 5:34 am

Active Member

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by i2Paq » Mon Jul 19, 2010 4:50 am

OpenCart v1.4.8b has been released!

ALL MODS HAVE BEEN UPDATED FOR 1.4.8/1.4.8b SUPPORT
- You can get updated versions by redownloading the package from your Account page
Q will update his packages when a new version of OC is released.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by zelda » Tue Jul 20, 2010 1:00 am

i2Paq wrote:
OpenCart v1.4.8b has been released!

ALL MODS HAVE BEEN UPDATED FOR 1.4.8/1.4.8b SUPPORT
- You can get updated versions by redownloading the package from your Account page
Q will update his packages when a new version of OC is released.
ok great to know. thanks so much

Active Member

Posts

Joined
Sat May 08, 2010 5:34 am

Post by webstudent1 » Tue May 17, 2011 2:32 pm

Q's module was updatd 3 days ago and tested on 1.4.9.5 working 100% OK.

New member

Posts

Joined
Thu Jan 07, 2010 2:24 am

Post by beeohdee » Mon May 23, 2011 10:53 am

Using the supplied handling fee module for a percentage of the total sale is pretty easy in 1.4.9

Code: Select all

1.  Open the handling fee module in the administrator and enter '0.00' for the Order Total, and the percentage you wish to charge in the Fee box e.g '0.03'
2.  Open catalog/controller/module/total/handling.php and change/add the following code:
public function getTotal(&$total_data, &$total, &$taxes) {
        // ADDED
        static $hf = -1;  // hf = Handling Fee
        static $sT = -1;  // sT = SubTotal
        
        if($hf == -1) {   
            $hf = $this->config->get('handling_fee');
        }
        
        if($sT == -1) {
            $sT = $this->cart->getSubTotal();
        }
        // END ADDED

3.  In the outer if statement change the '<' comparison operator to '>' 
//if ($this->config->get('handling_status') && ($this->cart->getSubTotal() < $this->config->get('handling_total'))) {
if ($this->config->get('handling_status') && $sT > $this->config->get('handling_total')) {

4.  Modify the inner if block as follows:
if ($this->config->get('handling_tax_class_id')) {
    if (!isset($taxes[$this->config->get('handling_tax_class_id')])) {
        // $taxes[$this->config->get('handling_tax_class_id')] = $this->config->get('handling_fee') / 100 * $this->tax->getRate($this->config->get('handling_tax_class_id'));
        $taxes[$this->config->get('handling_tax_class_id')] = ($this->config->get('handling_fee') * $sT) / 100 * $this->tax->getRate($this->config->get('handling_tax_class_id'));
    } else {
        // $taxes[$this->config->get('handling_tax_class_id')] += $this->config->get('handling_fee') / 100 * $this->tax->getRate($this->config->get('handling_tax_class_id'));
        $taxes[$this->config->get('handling_tax_class_id')] += ($this->config->get('handling_fee') * $sT) / 100 * $this->tax->getRate($this->config->get('handling_tax_class_id'));
    }
}
            
5.  Change the following line of code from
//$total += $this->config->get('handling_fee');
To
$total += $hf * $sT; 
Your subtotals should now show up and tally as a percentage of the total sale.
Last edited by Johnathan on Tue Jun 19, 2012 6:21 am, edited 1 time in total.
Reason: Added [code] tags for readability

Newbie

Posts

Joined
Fri Apr 01, 2011 5:20 am

Post by mozd » Mon Jun 18, 2012 5:29 pm

Hi what about on 1.5.1.3?Please Help.

Newbie

Posts

Joined
Thu May 03, 2012 3:43 pm

Post by Johnathan » Tue Jun 19, 2012 6:24 am

You could also use Total-Based Fee/Discount, which supports all versions between 1.4.8 and 1.5.3.x.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 5 guests