To get Current Url
<?php
$currentUrl = $this->helper('core/url')->getCurrentUrl();
?>
Get Magento Url including index.php if not rewrited.
e.g. http://www.example.com/index.php/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
Get Magento Media Url
e.g. http://www.example.com/media/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
Get Magento Skin Url
e.g. http://www.example.com/skin/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
Get Magento Store Url
e.g. http://www.example.com/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
Get Magento Js Url
e.g. http://www.example.com/js/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
Get Home URL
$magento_home_url = Mage::helper('core/url')->getHomeUrl();
Get not secure Skin URL:
$image = $this->getSkinUrl('images/magento-image.jpg');
Get secure Skin URL
$image = $this->getSkinUrl('images/magento-image.jpg', array('_secure'=>true));
Magento Syntaxes to use in CMS Content.
Get SKIN URL
{{skin url='images/magento-image.jpg '}}
Get Media URL
{{media url='/magento-image.jpg'}}
Get Store URL
{{store url='magento-page.html'}}
Get Base URL
{{base url='magento-page.html'}}
Get full Skin Url inside code
e.g. http://www.example.com/skin/frontend/default/default/
Mage::app()->getLayout()->getBlock('head')->getSkinUrl();
Thanks for all this. Can you please tell me how to add zoom on mouse hovering on the display picture of the main product?
ReplyDeleteRegards,
Prasant Saxena
Software Development Company
for this there are lots of free extension in the magento connect. I usually used :
ReplyDeletehttp://www.magentocommerce.com/magento-connect/moo-cloudzoom.html
$currentUrl = Mage::helper(‘core/url’)->getCurrentUrl()
ReplyDeleteor
$currentUrl = Mage::getUrl(‘*/*/*’, array(‘_current’ => true));
above code may not work always as expected.
Better way to find the current url is to use the following code:
if (!in_array(Mage::app()->getFrontController()->getAction()->getFullActionName(), array(‘cms_index_noRoute’, ‘cms_index_defaultNoRoute’))) {
$currentUrl = Mage::helper(‘core/url’)->getCurrentUrl();
}
Source: http://www.blog.magepsycho.com/how-to-find-current-url-in-magento/
Good artikel <a href="http://goo.gl/ZbN6tP> travel umroh ramadhan</a> > haji indonesia
ReplyDeleteGood artikel travel umroh ramadhan
ReplyDelete