views field php condition
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;