Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Rounding prices


Leo2

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?

Link to comment
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.

Link to comment
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?

Link to comment
Share on other sites

  • 10 years later...

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://www.oscommerce.com/forums/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?

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...