I installed the latest version because I needed the tax stuff (#399586: cha0s' attempt to solve the VAT display stuff), but the prices are still shown without VAT, I'm using <?php print theme('uc_product_price',$node->sell_price, 'sell-price', $no_label = 1) ?> but to be honest, I have no idea if this is the way to go?
Comments
Comment #1
Island Usurper commentedI suppose theme_uc_product_price() is actually deprecated, since it was replaced by uc_price() and it wasn't updated to use it.
Try using this code:
Now, I haven't seen that anyone has made a VAT module that uses the price handlers yet since it's still very new. You shouldn't actually see a difference in the price yet, unless you've got more code than I know about.
Comment #2
attiks commentedIt's working with the discount framework, but how can I do the same inside a views tpl.php file. The view only contains the title + sell price fields, so I don't have a node I can pass?
Is there any documentation on the context options, I checked uc_price.inc but it's still not clear (i couldn't find anything on the subject parameter).
Cheers
Peter
Comment #3
attiks commentedAnother 'problem', I want to be able to display both the regular price and the discount price on my node, does uc_price support this in any way?
Comment #4
Island Usurper commentedThe price field handler should be running the value through uc_price() on its own already. I've tried to fake a node object, but it only has the values that are selected by the View. You'll have to figure out what your discounts need to know about the node, and add that data as fields. You can then exclude those fields from being displayed. Not everything will work this way (I'm particularly thinking of taxonomy terms) since they aren't attached to the node through node_load() and it has a different structure.
You can get the original value by calling uc_price() again with the same parameters, except changing the "revision" key of the $context. The full list of revisions is
- 'original' => Original price value,
- 'altered' => Original price passed through the alterer(s),
- 'formatted-original' => Original price passed through the formatter,
- 'formatted' => Altered price passed through the formatter,
- 'themed-original' => Formatted original price passed through the theme layer,
- 'themed' => Formatted altered price passed through the theme layer.
Comment #5
attiks commentedTheming the original price is working by using 'themed-original', but I'm afraid I'm going to run into a problem:
I'm going to use the same mechanism (CA) for discounts and for taxes, but I need to be able to display the original price inlcuding taxes as well as the discount price including taxes. Is there a way to do this, can I specify which alterers to use (by class)?
Concerning the views problem, any ideas how to solve this, because the discounts will be managed based on the taxonomy (or is it easier/better to use CCK?), I know I can add the nid the the fields and do a full load in my theme function, but it is a bit over-kill.
Comment #6
shiroitatsu commentedsubscribing
Comment #7
Island Usurper commentedSo, I'm going back on what I said about theme_uc_product_price(). It's no longer deprecated, but it's signature has changed to look like
These parameters are passed directly to uc_price(), so to suppress the label, you should add
'label' => FALSEto $options.The reason for doing this was to allow the product view page to wrap the prices in block-level divs like it used to. theme_uc_price() only outputs spans which made the products look odd.
It was hinted at, but never discussed thoroughly to record the amount of each alteration to a price. That wouldn't be very hard to do, especially since it's up to the alterers to do that.
Comment #8
rszrama commentedTagging.
Comment #9
Island Usurper commentedYeah, this is done. And, in fact, there is a uc_vat module that changes the way prices are displayed.