Jump to content
Leo2

Rounding prices

Recommended Posts

I have USD as base currency, and rubles as default currency. So I enter prices in USD, and, since the exchange rate is like 29.21, I get ugly prices in rubles, like 2349. 43 rub.

 

What I need is to round prices in rubles. So, for example, price in rubles would be 2350 rub.

 

Does such contribution exist?

Share this post


Link to post
Share on other sites

You dont need a contribution for this in admin>configuration>my shop modify the tax decmal place to two places this will rd things up for you or whatever amount of decimal places you need but it looks like two from the example you posted above.

 

Goodluck.


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites
You dont need a contribution for this in admin>configuration>my shop modify the tax decmal place to two places this will rd things up for you  or whatever amount of decimal places you need but it looks like two from the example you posted above.

 

 

Doesn't work. I use prices without tax (tax is included; people like to see final price in the catalog, not only when they finilize an order).

 

So, if I have a product which costs , say 60 USD, and exchange rate is 29.29, I get price in rubles 1,757.40.

 

What I need - to have integer prices in rubles ending with 0 (should be 1760 in example above).

 

Any ideas?

Share this post


Link to post
Share on other sites

I am still running my oscommerce shop :) For years since prevous post ruble was stable and I moved to RUB as default. Now we have jumping currency exchange rate and I had to set back the USD as default currency. So, the problem appears again.

 

I found this workaround http://forums.oscommerce.com/topic/140316-silly-prices-when-currency-not-default/

 

However, it rounds all currencies. I need to round only rub, which is not default currency. Default USD must remain with decimal places.

 

I tried to set decimal places to 0 for rubs, but in this case all the prices are calculated wrong (seems the USD price is rounded and then exchange rate is applied)

 

Can anybody help?

Share this post


Link to post
Share on other sites

in the format function, there is a line to check if a rounding parameter is passed like this one

 

  if ($round != 1) {

 

change it and add a check to see if the currency is also different from USD, that should do the trick

$currency is passed along in this function as a global value, so you have the info to do the check


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×