Post by jens_b » Fri Apr 04, 2014 1:19 am

Hi,

Runned into a problem, my store got multiple currencys,
I would like to round up all currencys so it wont show any cents,
BUT not in the TAX calculation in the cart.

Example:
Default currency is SEK, one product cost 499.00 SEK (the tax shows 99.80 in the cart) Tax is 25%.
If changing to EUR, the product costs 55.75 €, here I want it to round up to 56.00 (and the tax will then be 11.20 in the cart), its also ok if it just rounds up "visually" on the productpage to 56.00 but is still 55.75 (tax 11.15) in the cart.

But can get this to work. If changing decimals for the currency to 0, then the tax calculation is wrong (as it needs 2 decimal to be correct)
I've tried add $value = round($value, 0); in admin/model/localisation/currency.php, but then also the tax is rounded in the cart.

It's mostly products that costs 500€ - 5000€ that why I want it to round up without cents, but the tax-law is strict on the cent.

Thanks for any input on this!

New member

Posts

Joined
Mon Oct 28, 2013 6:19 pm

Post by dimul » Fri Apr 04, 2014 10:42 am

if you want just in view product page, edit product.tpl in \catalog\view\yourtheme\default(yourtheme)\template\product\
find price or special (if any) variable, then use ceil to round up. example bellow

Code: Select all

ceil($price)
seem you should also edit module template (related to price product)

Regards,

Dian M Tanjung


New member

Posts

Joined
Sat Feb 01, 2014 5:01 pm
Location - Indonesia

Post by jens_b » Fri Apr 04, 2014 3:59 pm

Hi, thanks!

But get a few problems with it. It removes the right currency symbol, also it rounds prices that are higher than 1000 to 1,
so a price 647.86 rounds to 648 (all good except for the currency symbol)
but 3898.33 will show as simply 3, any idea what can cause this?

New member

Posts

Joined
Mon Oct 28, 2013 6:19 pm

Post by dimul » Fri Apr 04, 2014 6:40 pm

open \catalog\controller\product\product.php
add ceil procedure in input $this->currency->format
example for price (you can add this in special/tax/discount) :

Code: Select all

$this->data['price'] = $this->currency->format(ceil($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))));

Regards,

Dian M Tanjung


New member

Posts

Joined
Sat Feb 01, 2014 5:01 pm
Location - Indonesia

Post by jens_b » Fri Apr 04, 2014 8:55 pm

Thank you very much dimul, works great!

New member

Posts

Joined
Mon Oct 28, 2013 6:19 pm
Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 318 guests