There is no value visible in a view for fields with field handler 'uc_views_handler_field_money_amount' (e.g. fields price and cost of table 'uc_order_products' ).
I think the problem is, that $this->options['format'] is adressed in render()-func of field handler. But this option-attribute is not set (in whole class hierarchy of parent field handlers).
I used the version ubercart-6.x-2.0-rc6 of ubercart module with parent field handler 'uc_product_handler_field_price'.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | uc_views_666038_9.patch | 1.05 KB | glennpratt |
Comments
Comment #1
madsph commentedthe uc_views_handler_field_money_amount was introduced because the handle from ubercart changed to have a dependency to node, around rc4. Baybe some thing new has come up - I will have to look into it, and get back to you.
Comment #2
kevinquillen commentedYes. I just altered that views file. If you dump $values, the price isn't in that object. I had to add uc_order_load($values->order_id) and return uc_price($order->order_total) to get this to work.
Comment #3
jrust commentedI'm also seeing this problem: all "money" values (order total, product price, etc) are showing up as 0. The problem seems to be that the SQL field is never added to the query (i.e. "uc_order_products.price AS uc_order_products_price" is never added). I tried to hunt down why that is, but to no avail. As a temporary solution I changed uc_views_handler_field_money_amount to views_handler_field_numeric.
Using uc_views 3.x-dev and ubercart 2.2
Comment #4
madsph commentedFinally back from holiday :-)
I have tested this with the dev version of Ubercart and the latest release (2.2). And as you report there is a problem with the official release version, whereas the current release candidate does not have the problem.
Since uc_views 3.x is aimed at keeping up with the latest Ubercart versions, I prefer to not fix this problem against Ubercart 2.2.
This was one of the key issues holding me back from making an official 3.0 release of uc_views untill other pressing matters made it seem better to make it any way - I hope the Ubercart development stuff finds their way into a release soon.
If there is any thing I can do to make life easier with Ubercart 2.2 please let me know.
Comment #5
kevinquillen commentedIsn't Ubercart 2.2 the latest version? We can't use a dev version of Ubercart on production sites.
Comment #6
madsph commentedI totally agree - and that is why I am hoping for a release of Ubercart soon. My problem is that they keep changing this, so no matter what I do I get bug reports :-(.
I think the best thing to do is to change all usage of
uc_views_handler_field_money_amountinuc_views.views.incwithuc_product_handler_field_pricewhich is the original handler from Ubercart which worked before they changed it.Comment #7
kevinquillen commentedHm. Well, in my case (and others I am sure) uc_views is pretty critical for solid views reporting. Ubercart doesn't (but should IMO) provide the kinds of views you can do with this especially bulk printing, grouping order totals by payment method, etc. Payment method still says 'error handler not found' for me as well, I could not get that one fixed like the price.
Do they keep changing it from release to release?
Comment #8
glennpratt commented#6 Didn't work for me. Also, that would use uc_product_handler_field_price looks for Order totals, which wouldn't work.
I don't mean to be rude, and I really appreciate this module, but I'd like to cast my vote to not target Ubercart dev with uc_views release versions. It's pretty confusing and most people won't even consider running a dev version of Ubercart.
Anyway, I'll be working on this the next few days, and if I can roll a patch I will submit, but I'm a complete n00b to Ubercart, so if there are any suggestions, I'd be glad to hear it.
Comment #9
kevinquillen commentedTry #2
Comment #10
glennpratt commentedJust ignore this.
Comment #11
glennpratt commentedThanks, I wasn't sure how that would affect other uses of the handler, since order_total isn't the only use.
Comment #12
kevinquillen commentedWas in my case, I just needed to get it working
Comment #13
madsph commentedNo problem - I need people to say what they mean - especially when they are making a valid point like you.
I am not fond of targeting a dev release of Ubercart either - this is all borne out of another bug report that was filed when some people started upgrading to some of the RC releases. And since the RC was at number 6 at that point I figured the final version had to be upcoming. That along with the more or less urgent need to make a release of uc_views resulted in this situation.
While this is all history and therefor more or less of no interest - I think I need to find a way to make the two solutions co-exist. So what I propose to do is to either make two mappings of the field that is targeted at different handlers to use with each of the Ubercart versions, or let the handler react differently if I am able to detect the installed version of Ubercart. I haven't thought the last solution through though.
I am pretty hung up on work at the moment - so I am sorry that I have been a little late to join this debate. I can't say when I will have fix either, but I promise to look into it as soon as I get a spare moment.
Comment #14
xacobe#10 works well to me. Thanks glennpratt. Im using Ubercart.2.2 and UC_Views.dev. The only thing Im not able to see is the shipping cost, the field "amount" keeps 0.00€.
Essential module to get reports
Comment #15
hanoiiSorry to step in this issue a bit late, but somebody can resume the steps needed to look at this issue. I am currently using Ubercart 2.2 with the latest uc_views and I see no problem. I also worked on this handler before and I am curious on what might be going on on your sides.
Comment #16
hanoiiI looked at this a bit further and the reason of this working for the -dev version of ubercart and not the current stable release is because of the following patch:
http://drupal.org/node/578334#comment-2262226
Which I submitted some time ago. When I first got to this issue I reviewed that patch and the version of ubercart referenced on the previous issue confused me, but I checked again and that bug is still valid for the 2.2 version, the fix was committed a few days after.
Although most workarounds and patches within this issue may work, I'd recommend applying the previous patch to your 2.2 ubercart (after all, it was committed in Ubercart) and go back to the stable (or dev version for that matters) of this module.
I am flagging this as duplicate of that issue, although it's not the same issue, it's the cause of the 0 display for product prices.
Worth noting that the patch for ubercart will also add some nice customization options to the product price handler (and the mony amount handler of this module).