views field php condition I use drupal6 and UC2. I am working on a view which exports order details into an excel file such as - address and total order amount. Total amount field is crucial for me - Would it be possible to use views php and check if payment method is COD then get total amount. If payment method is different than COD then result would be nothing or 0?

Thank you
You can certainly do that. If you setup a view and tell it to grab Ubercart Order data it will allow you to access information on orders such as the payment type, amount, order id, etc.

So if you grab the following information you'll be set to feed it into the Views PHP field.


Payment Method
Order Total (Exclude this from the display)


Then if you add the Global: PHP field you need to put the following into the Value code field:

if ($data-&gt;uc_orders_payment_method == "cod") {
  return number_format($data-&gt;uc_orders_order_total, 2, '.', ',');
} else {
  return number_format(0, 2, '.', ',');
}


And this in the output code field:

&lt;?php
  print $value;
?&gt;