Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2010 at 17:23 UTC
Updated:
12 Dec 2011 at 08:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
eiland commentedyou can change the field display using field-templates;
Override
views-view-field.tpl.phpby addingviews-view-field--field-PRICE-value.tpl.phpto your theme folder and make itas per http://views-help.doc.logrus.com/help/views/using-theme.
Comment #2
fehin commentedHi eiland, thank you for your help.
I placed the code below in
views-view-field--list-price.tpl.phpand all I saw is long "?????????????????" in the list-price field.What I'm trying to achieve is check to see if list-price is greater than $0.00 and greater than sell-price. If this is true, then list-price prints otherwise the field should be hidden. Is my code not correct? Thanks.
Comment #3
eiland commentedhi,
sorry im not familiar with übercart but you could try to put
<?php drupal_set_message('<pre>' . var_export($row, true) . '</pre>'); ?>to see whats inside the object.Comment #5
nyleve101 commentedHi,
did anyone find a solution to this issue?
Hope all is well!
Evelyn
Comment #6
guypaddock commentedSorry, guys, but this is pretty clearly a bug. This *would* be a feature request if the module hid the "Count the number 0 as empty" checkbox that Views provides by default. Since it does not, this is a bug because UberCart is not honoring the setting.
Comment #7
guypaddock commentedPatch for this issue is attached.
I've also noticed that if you select "Numeric" for "Display Type", nothing is shown, but this isn't caused by my patch (pre-existing bug). I'll file an issue about it.
Comment #8
guypaddock commentedSetting to "Needs Review".
Comment #9
guypaddock commentedSame patch, re-rolled for 6.x-2.x-dev
Comment #10
guypaddock commentedIgnore this patch. See the next one in the thread. I'm not sure why I've handled this issue so poorly...
Comment #11
guypaddock commentedThis one is the *actual* re-roll for 6.x-2.x-dev with bug fix. The previous version in #9 wasn't detecting zero properly, and #10 was saved by Google Chrome via a download from one system to another, so it got converted to HTML.
Comment #12
longwaveMarked #1303506: List price on views: how to hide if zero ? as duplicate
Comment #14
longwaveThis patch is simpler and seems to work for me.
Comment #15
longwaveThis patch is more true to the original code, and also fixes the "Hide if empty" checkbox so the field can be hidden for nodes which are not products, as noted in #356919: price handler returns an apparent zero price for non-product
Comment #16
mandreato commentedGood news: this patch works !
Bad news: I've to patch uc_vat too, because uc_vat_handler_field_price extends uc_product_handler_field_price so also its render function needs to be revisited in the same manner...
OT: @longwave uc_vat seems to have some important bugs... do you plan to still mantain that module, or you think to leave it behind, since it's not needed anymore in Ubercart 7.x-3 ?
Comment #17
longwaveCommitted #15 to 6.x, needs porting to 7.x.
@mandreato: uc_vat will get fixed if I find the free time, or someone else submits a fix. I don't intend to port it to 7.x, as inclusive taxes are handled in Ubercart core, and the other features should probably be moved into core as well.
Comment #18
mandreato commentedThank you very much longwave !
Comment #19
longwaveFixed in 7.x: http://drupalcode.org/project/ubercart.git/commitdiff/7b492e2
Comment #21
sarhansg commentedSorry to post in a closed topic. However, the patch does not work for List and Cost price. In the site I am working on we show List and Cost price in the view so visitors can easily compare the mark-down value. However, when Cost price is $0 it is still shown. I'm using 6.x-2.x-dev version where the patch has already been implemented.