Closed (fixed)
Project:
Ubercart
Version:
6.x-2.0-rc3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 May 2009 at 02:08 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tr commentedThat sounds like a good idea, for the following reason:
Most contributed code still uses uc_currency_format(). There is not yet documentation for uc_price(). So, it's going to be a while, maybe a long while, before all the modules out there get converted over to using uc_price(). Until then, price handlers will not be able to affect prices generated by these modules.
In addition to contributed modules, people may be using uc_currency_format() in theme function overrides or templates. Price handlers aren't able to touch those either.
The price handler system isn't useful unless it can alter/format *all* prices, and it seems the only way to do this while keeping Ubercart compatible with existing code is to make uc_currency_format() a wrapper for uc_price().
Comment #2
rszrama commentedComment #3
rszrama commented.
Comment #4
Island Usurper commentedThis will really only work for the price alterers that don't care what type of price it is because there isn't any extra information about it available. So if themers are displaying a price that's more than just a basic amount, I'd still encourage them to use uc_price() with appropriate $context.
Comment #5
rszrama commentedDon't think this needs any additional testing... worked fine embedded in a test page on the Livetest.
Committed!
Comment #6
torgospizzaThanks, Ryan! Just wanted to mention my quick support for this. While moving our stuff to D6 I noticed that $node->sell_price in my product.tpl file showed "0.990" - which ignores our "2 decimal places" setting. Didn't want to use uc_price() since I'm still unfamiliar with it. But using uc_currency_format($node->sell_price) worked like a charm - especially when, for building our theme, that's really all we need. Thanks for keeping it in :)
Comment #7
rszrama commentedHoorah. : D
We're also extending the support for the "decimal places" setting a bit, too, so that should help you.