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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -