Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm trying to create a conditional field that checks to see if list-price is greater than sell-price or list-price is equal to $0.00. I would like to use this with views; hide the list-price field if the above is true. How can I achieve this? Thanks.
Comments
Comment #1
fehin CreditAttribution: fehin commentedI received an email about this today so I'm posting my solution for anyone looking for something similar.
I created a cck field called "sales_list_price" and used "computed" widget and I used the code below. Then in my views, I used this field instead of Ubercart list price field.
Computed Code: ---- This is saying if Ubercart List price is greater than Sell price and if List price is greater than $0 then show the value of list price. Otherwise don't show anything.
Display Format: ------ This is saying if the value is greater than 0, display the value and with a $ sign in front.
Comment #2
fehin CreditAttribution: fehin commented