-
- adamchodson

-
Total Posts: 2
Joined: 2012-09-25
|
I’m trying to hide or display a div based on the cart grand total. For instance, if the cart grand total is less than $79, i’d like to hide the div. I’ve tried using conditional statements but it’s not quite working. I’ve tried using the below code in onepage.phtml, review.phtml (where the div is placed) and in the actual file that holds the div I’d like to hide.
<?php
$totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals();
$subtotal = round($totals["subtotal"]->getValue());
$grandtotal = round($totals["grand_total"]->getValue());
if ($grandtotal <= '79'){ ?>
<script type="text/javascript\">$(’#gifterWrap’).hide()</script>
<?php
}
?>
Any insight would be much appreciated.
|