Post by aboutwd » Fri Jan 21, 2011 1:52 am

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

Newbie

Posts

Joined
Fri Jan 21, 2011 1:43 am

Post by Qphoria » Fri Jan 21, 2011 4:15 am

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by aboutwd » Wed Feb 09, 2011 4:50 am

Wow, That worked perfectly. Thanks so much for your help.

I love Opencart.

Newbie

Posts

Joined
Fri Jan 21, 2011 1:43 am

Post by vayaruina » Tue May 03, 2011 4:52 am

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

Newbie

Posts

Joined
Tue May 03, 2011 4:49 am

Post by vayaruina » Wed May 04, 2011 2:33 pm

Solved with Johnathan help based on Qphoria´s code.

Attached handling.php

Thank you very much to all

Newbie

Posts

Joined
Tue May 03, 2011 4:49 am

Post by komzol » Mon Nov 21, 2011 3:36 am

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.

Newbie

Posts

Joined
Mon Nov 21, 2011 1:30 am

Post by Qphoria » Wed Nov 30, 2011 5:23 am

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;
}

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by komzol » Wed Nov 30, 2011 4:56 pm

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.

Newbie

Posts

Joined
Mon Nov 21, 2011 1:30 am

Post by Gilmore » Fri Feb 03, 2012 1:48 pm

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.

Thanks!

Gilmore


User avatar
Active Member

Posts

Joined
Thu Aug 12, 2010 7:33 am

Post by Concept211 » Thu Jun 27, 2013 1:54 am

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!)

User avatar
New member

Posts

Joined
Fri Oct 14, 2011 1:40 am

Post by jprout » Tue Apr 29, 2014 3:01 am

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?

Newbie

Posts

Joined
Fri Feb 21, 2014 4:29 am

Post by EvanJ » Thu Apr 16, 2015 5:44 am

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

Newbie

Posts

Joined
Wed Jun 25, 2014 1:21 am
Who is online

Users browsing this forum: No registered users and 12 guests