Page 1 of 1
Handling Fee on Download Products
Posted: Fri Jan 21, 2011 1:52 am
by aboutwd
Handling is working fine, but the cart charges Handling on ALL products - even downloads.
How do I exempt downloads from the Handling Fee?
I tried making a new tax class called "Digital download" and then apply the Handling fee to only "Taxable Goods". But that didn't work.
Any thoughts would be helpful.
Thanks
Re: Handling Fee on Download Products
Posted: Fri Jan 21, 2011 4:15 am
by Qphoria
You dont apply the tax class.. that just tells if that fee should be taxed as well.
Handling fee is a "cart-level" fee and doesn't check the products. But you can add filtering easily:
1. EDIT: catalog/model/total/handling.php
2. FIND:
Code: Select all
if ($this->config->get('handling_status') && ($this->cart->getSubTotal() < $this->config->get('handling_total'))) {
3. REPLACE WITH:
Code: Select all
if ($this->config->get('handling_status') && $this->cart->hasShipping() && ($this->cart->getSubTotal() < $this->config->get('handling_total'))) {
Probably should be a core change since items without shipping shouldn't need handling
Re: Handling Fee on Download Products
Posted: Wed Feb 09, 2011 4:50 am
by aboutwd
Wow, That worked perfectly. Thanks so much for your help.
I love Opencart.
Re: Handling Fee on Download Products
Posted: Tue May 03, 2011 4:52 am
by vayaruina
Hi Qphoria :
How can we integrate this code lines into your Mod MultiTotalHandling_OCv149.1.zip ?
It would be so useful not to add handling fees to tha products that has "No Transport needed" , such as installation services on my case , and so....
I have tried with your MultiTotalHandling_OCv149.1 but it charges fee on total cart.
Thank you
Re: Handling Fee on Download Products
Posted: Wed May 04, 2011 2:33 pm
by vayaruina
Solved with Johnathan help based on Qphoria´s code.
Attached handling.php
Thank you very much to all
Re: Handling Fee on Download Products
Posted: Mon Nov 21, 2011 3:36 am
by komzol
I am set up handling fee. It is working well but I would like to disable handling fees if someone pick up from the store. Anybody can help me how can I made this change in opencart 1.4.9.4?
Thank You.
Re: Handling Fee on Download Products
Posted: Wed Nov 30, 2011 5:23 am
by Qphoria
komzol wrote:I am set up handling fee. It is working well but I would like to disable handling fees if someone pick up from the store. Anybody can help me how can I made this change in opencart 1.4.9.4?
Thank You.
1.4.x
1. EDIT: catalog/model/total/handling.php
2. FIND:
Code: Select all
public function getTotal(&$total_data, &$total, &$taxes) {
3. AFTER, ADD:
Code: Select all
if (isset($this->session->data['shipping_method']['id']) && $this->session->data['shipping_method']['id'] == 'pickup') {
return;
}
1.5.x
1. EDIT: catalog/model/total/handling.php
2. FIND:
Code: Select all
public function getTotal(&$total_data, &$total, &$taxes) {
3. AFTER, ADD:
Code: Select all
if (isset($this->session->data['shipping_method']['code']) && $this->session->data['shipping_method']['code'] == 'pickup') {
return;
}
Re: Handling Fee on Download Products
Posted: Wed Nov 30, 2011 4:56 pm
by komzol
Thank you for your fast reply. I added your code but there is still handling fee is someone pick up from the store.
my handling.php is here
Code: Select all
<?php
class ModelTotalHandling extends Model {
public function getTotal(&$total_data, &$total, &$taxes) {
if (isset($this->session->data['shipping_method']['id']) && $this->session->data['shipping_method']['id'] == 'pickup') {
return;
}
if ($this->config->get('handling_status') && ($this->cart->getSubTotal() < $this->config->get('handling_total'))) {
$this->load->language('total/handling');
$this->load->model('localisation/currency');
$total_data[] = array(
'title' => $this->language->get('text_handling'),
'text' => $this->currency->format($this->config->get('handling_fee')),
'value' => $this->config->get('handling_fee'),
'sort_order' => $this->config->get('handling_sort_order')
);
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'));
} 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'));
}
}
$total += $this->config->get('handling_fee');
}
}
}
?>
Would you please have a look at it, if I made a mistake?
Thank you.
Re: Handling Fee on Download Products
Posted: Fri Feb 03, 2012 1:48 pm
by Gilmore
So what is the edit for v1.5.1.3? I tired the handling.php above and get a jSON error
Code: Select all
SyntaxError: JSON.parse: unexpected character
after you agree to the terms on checkout when you have Handling Fee enabled.
Re: Handling Fee on Download Products
Posted: Thu Jun 27, 2013 1:54 am
by Concept211
I went ahead and created a vQmod based on Q's code above:
http://www.opencart.com/index.php?route ... n_id=12376
(thanks Q!)
Re: Handling Fee on Download Products
Posted: Tue Apr 29, 2014 3:01 am
by jprout
I would like to be able to add a handling fee to selected products, not all products. Is there a way to add this fee to the Catalog/Products/Data page in the admin for select products?
Re: Handling Fee on Download Products
Posted: Thu Apr 16, 2015 5:44 am
by EvanJ
Would it be possible for someone to update the code for excluding downloads for Opencart 2? It would be great to have this feature available in the new version.
Thanks!
Evan