hi

in views I did the following (D7)
1) added a field with math expression with 2 fields to calculate a percentage
[commerce_order_total]/[field_project_goal]*100
this gives me a number.

2) added a custom field where I use this number as:
[expression] % funded.
=>output: 70% funded

3)When I add a custom phpfield with the following code in the output field:

<?php
$progress = $row->expression; 
echo" <div id=\"progressbar\"><div style=\"width: $progress%;\"></div></div>";
?>

the $progress variable is empty.

I need to use a php custom field because the css style settings are deleted in a custom field.

What goes wrong?

thx
Blueblot

CommentFileSizeAuthor
screen1.jpg35.3 KBblueblot

Comments

mrweiner’s picture

Status: Active » Closed (duplicate)

This seems to be a duplicate of #1140896: Variable $row does not contain correct values ($data->_field_data does). The problem is that $row doesn't contain the information that it theoretically should. There's some workarounds in this other issue as well. Hopefully one of them helps you out.