Qphoria wrote:markisonfire wrote:This should be a pretty simple help request, I just can't seem to get it working. Basically, I want to lay an image over another image when $price is greater than a certain value. Here is my code:
Code: Select all
<?php if($price >= 150) { ?><div style="position: relative;"> <?php } ?>
"$price" is a formated string value, not a number
Try ($product_info['price'] > 150) as that is the unformatted price
That's the stuff, right there. A question about MVC for you, then, Mr. Q. Should this be in the controller file? What would the best practice be for something like this? Should I place this in the controller and then call it with a variable in the view tpl file?
[edit] And while we're at it, what would I call if I wanted to have this happen in, say, featured_content.tpl? $product_info['price'] returns a nasty little error. [/edit]
The code you posted works, by the way. I assumed that $price wasn't a numerical value, I just wasn't too sure what to do. Thanks!