Page 1 of 1

Display estimate shipping costs without tax

Posted: Sun Nov 03, 2013 3:52 am
by slingeraap
In my 1.5.3.1 OC shop, I display product prices with tax included. But in the estimate shipping costs, I want to display the shipping costs without tax. How can i do this?

I see that the estimated price in the popup is generated by javascript in the checkout\cart.tpl file of my template.

Code: Select all

<label for="' + json['shipping_method'][i]['quote'][j]['code'] + '">' + json['shipping_method'][i]['quote'][j]['text'] + '</label>
But that one includes the price including tax already. It is generated elsewhere. Anybody knows where i have to look to change it to the price without tax?

Re: Display estimate shipping costs without tax

Posted: Mon Nov 04, 2013 12:54 am
by butte
Did you try this, https://www.google.com/search?q=estimat ... encart.com . . . and then try refining it?

Re: Display estimate shipping costs without tax

Posted: Wed Nov 06, 2013 9:03 am
by Johnathan
So you want to show the shipping price without tax, but still have a tax class applied? You'd need to change each shipping method so that it doesn't add this into its "text" when passing it back to OpenCart. It should all be pretty similar code, but as an example, here's what you'd change for the Flat Rate shipping:

Code: Select all

IN:
/catalog/model/shipping/flat.php

REPLACE:
'text'         => $this->currency->format($this->tax->calculate($this->config->get('flat_cost'), $this->config->get('flat_tax_class_id'), $this->config->get('config_tax')))

WITH:
'text'         => $this->currency->format($this->config->get('flat_cost')) 
I haven't tested that, but I think it should work.