Magento 1 useful
$request = $this->getRequest();
$module = $request->getModuleName();
$controller = $request->getControllerName();
$action = $request->getActionName();
<?php if(strrpos($this->helper('core/url')->getCurrentUrl(),'checkout/onepage') != false){ echo 'class = "inner-main"'; } ?>
\!h ----- Secure Url SSL
Go to admin System -> Configuration -> Web -> Secure
change ‘Base URL’ to
https://your-domain
change ‘Use Secure URLs in Frontend’ to ‘Yes’ and Save Config.
\!h ----- currency symbol price anywhere product price
<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol().number_format($_product->getFinalPrice(), 2) ?>
\!h ----- Currency Symbol to right. after price
lib/Zend/Currency.php
self::RIGHT
http://www.youtube.com/watch?v=6Xj2Xn6OAZE
Mage::app()->getLocale()->currency(Mage::app()->getStore()->
getCurrentCurrencyCode())->getSymbol()
- See more at: http://magentoexpert.blogspot.com/2010/01/how-to-get-currency-symbol.html#sthash.7sYQNfJu.dpuf
http://xme.im/format-magento-currency-or-number-base-on-locale
\!h ----- parse url url without index path парсить url
substr($this->getUrl(''), 0, strrpos($this->getUrl(''), '/index.php')).'/skin/'.$productvideo
<?php if(strrpos($this->helper('core/url')->getCurrentUrl(),'checkout/onepage') != false){ echo 'class = "inner-main"'; } ?>
\!h ----- welcome message
app/code/core/Mage/Page/Block/Html/Header.php
\!h ----- custom variables
echo Mage::getModel('core/variable')->loadByCode('recently_searched')->getValue('text');
echo Mage::getModel('core/variable')->loadByCode('recently_searched')->getValue('html');
\!h move block in xml
<sales_order_view translate="label">
<reference name="my.account.wrapper">
<action method="unsetChild"><name>sales.order.view</name></action>
</reference>
<reference name="sales.order.info">
<action method="insert"><block>sales.order.view</block></action>
</reference>
</sales_order_view>