9 replies [Last post]
jholder's picture
Offline
Joined: 09/25/2009
Juice: 10
Was this information Helpful?

Hi,
We're running Ubercart v2 RC7 in Drupal. Yesterday I upgraded to RC7 from RC6, and a new issue has arisen.

When prices are displayed, here are too many cent places. For example, instead of:
$26.99
prices are displaying as:
$26.99000

I looked through to see if perhaps a setting had been reset, but can't find it. Any ideas?

Thanks
john

xibun's picture
Offline
Joined: 05/13/2009
Juice: 104
Hi John, in the database the

Hi John,

in the database the precision was increased for us over here in Europe, we have rounding issues otherwise (VAT tax). but in the store a customer shouldn't see a difference. it should be only two decimal places.

- where exactly do you see it?
- are you using any special module which is manipulating the price in a way or another?

cheers
Marco

jholder's picture
Offline
Joined: 09/25/2009
Juice: 10
Re: Hi John, in the database the

Thanks for the reply Marco.

The customers are seeing it on the products page. Here's a link:
http://www.doctorgrandmas.com/store/wheat-berries/whole-wheat-berries-15...

On:
/admin/store/settings/store/edit/format
I have it set to 2 decimal places, yet it still displays 4

I've tried disabling all optional modules, yet the issue still occurs. I found a similar post here:
http://www.ubercart.org/forum/bug_reports/11066/extra_0_end_sale_price_a...

But have no idea where to find the .tpl file.

Thanks again!

xibun's picture
Offline
Joined: 05/13/2009
Juice: 104
Re: Re: Hi John, in the database the

I couldn't find that file myself.

but I would look for .tpl.php in the theme folder.

hope that helps.

harrisben's picture
Offline
Joined: 04/17/2009
Juice: 192
Re: Re: Re: Hi John, in the database the

Further to xibun's comment, you might like to look through any custom code for formatting prices and change instances of uc_price() to uc_currency_format(). I know that I've experienced a glitch related to this since updating.

jholder's picture
Offline
Joined: 09/25/2009
Juice: 10
Re: Re: Re: Re: Hi John, in the database the

Thanks! While I do that, do you know if I can replace with a backup I made, then run update.php?

harrisben's picture
Offline
Joined: 04/17/2009
Juice: 192
Re: Re: Re: Re: Re: Hi John, in the database the

Where is your custom code (ie what files)?

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Re: Re: Re: Re: Re: Hi John, in the database the

jholder: It's clear from the above link to your product page that you're using a custom template to display your product page. My guess is your template was coded wrong, and improperly prints $product->sell_price instead of using uc_currency_format() or uc_price() to display the price. Look for node-product.tpl.php in your theme directory, and fix it. As an aside, I don't see anything on your product page that would call for a custom template, so I would suggest theming the product page without a template so you don't run into things like this and other inevitable problems.

<tr>.
cachilupi's picture
Offline
Joined: 01/09/2008
Juice: 20
Re: Too many cent places in RC7

I'm having the same problem, but don't have a custom template defined. You can see it here:
http://www.doctorgrandmas.com/store/whole-wheat-mixes/muffin-mixes/bulk-...

I've looked through the UC code and don't see where this is being themed. Are there .tpl.php files within Ubercart? I found theme_uc_product_add_to_cart(), which is directly below the price, but never found exactly where this gets called for the product page.

Thanks,
Chuck

harrisben's picture
Offline
Joined: 04/17/2009
Juice: 192
Re: Re: Too many cent places in RC7

Are you sure you're not using a custom node.tpl.php or node-product.tpl.php because your site, which looks wonderful btw, doesn't look anything like standard Ubercart.