I seem to be a bind. I have this code below
...
foreach ($items as $item)
{
?>
{exp:channel:entries
channel="foo"
search:field_name="<?php echo $item['some_key']; ?>"
limit="1"
}
{if no_results}
<td>None</td>
<td>0.0</td>
{/if}
<td>{some_cost}</td>
<td>
<?php
$price = number_format( floatval("{some_cost}") + floatval("{some_margin}"), 1);
echo $price;
?>
</td>
{/exp:channel:entries}
<?php
}
...
As you can see, I need to pass the value of a PHP variable into the channel entries tag. For this case, we want PHP to parse early, before EE tags. So that means PHP parsing stage should be set to "input"
But I also need to get the values of the EE tags inside the channel entries and compute them in PHP. However, that means that we want PHP to parse late, after EE tags are parsed. That could be done if PHP parsing stage should be set to "output"
Obviously, I can't set PHP parsing stage to both values.
Is there a way around this problem?