php - IF current url equals Onepage Checkout hide element ELSE show element - Magento -
i trying write simple script hide "checkout" button located on sidebar mini cart in magento if on checkout page. obvious reasons don't think checkout button should still visible if customer on checkout page...
here have done not working , not sure how far off am.
<?php if(mage::geturl('checkout/onepage') == mage::helper('core/url')->getcurrenturl()): ?> <?php echo $this->__('checking out...') ?> <?php else: ?> <button type="button" title="<?php echo $this->__('checkout') ?>" class="btn btn-mini btn-success" onclick="setlocation('<?php echo $this->getcheckouturl() ?>')"><span><span><?php echo $this->__('checkout') ?></span></span></button> <?php endif ?>
if kind enough give me shift in right direction i'd grateful or let me know of better method...
try this:
mage::geturl('checkout/onepage') // or $this->geturl('checkout/onepage')
this url checkout/onepage route
mage::helper('core/url')->getcurrenturl()
this current url
now compare them:
<?php if(mage::geturl('checkout/onepage') == mage::helper('core/url')->getcurrenturl()) ?>
Comments
Post a Comment