for current currency
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
for currency symbol
Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
Hope it helps... Thanks....
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
$order = Mage::getModel('sales/order');
$order->load(Mage::getSingleton('sales/order')->getLastOrderId());
$lastOrderId = $order->getIncrementId();
Mage::getSingleton('checkout/session')->getLastRealOrderId();
getConnection('core_write');
$mysqli->query($sql);
/*
Process_id Indexer_code
1 catalog_product_attribute
2 catalog_product_price
3 catalog_url
4 catalog_product_flat
5 catalog_category_flat
6 catalog_category_product
7 catalogsearch_fulltext
8 cataloginventory_stock
9 tag_summary
*/
$process = Mage::getModel('index/process')->load(7);
$process->reindexAll();
echo "Finished Rebuilding Search Index At: " . date("d/m/y h:i:s");
?>
$productId = 1;
$product = Mage::getModel('catalog/product')->load($productId);
$path = Mage::helper('catalog/image')->init($product, 'image')->resize(75, 75);
<admin>
<routers>
<adminhtml>
<args>
<frontName><![CDATA[admin]]></frontName>
</args>
</adminhtml>
</routers>
</admin>
<frontName><![CDATA[admin]]></frontName>
<frontName><![CDATA[backend]]></frontName>
$todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
$collection = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))
->addAttributeToFilter('news_to_date', array('or'=> array(
0 => array('date' => true, 'from' => $todayDate),
1 => array('is' => new Zend_Db_Expr('null')))
), 'left')
->addAttributeToSort('news_from_date', 'desc')
->addAttributeToSort('created_at', 'desc');
<?php
$allStores = Mage::app()->getStores();
foreach ($allStores as $_eachStoreId => $val)
{
$_storeCode = Mage::app()->getStore($_eachStoreId)->getCode();
$_storeName = Mage::app()->getStore($_eachStoreId)->getName();
$_storeId = Mage::app()->getStore($_eachStoreId)->getId();
echo $_storeId;
echo $_storeCode;
echo $_storeName;
}
?>
if(!Mage::getSingleton('customer/session')->isLoggedIn())
{
$this->_redirect('customer/account/login/');
}
<?php Mage::getUrl(); ?>
$categoryUrl = Mage::getModel('catalog/category')->load($categoryId)->getUrl();
$productId = 1;
$product = Mage::getModel('catalog/product')->load($productId);
$path = Mage::getUrl().$product->getUrlPath();
$productId = 1;
$product = Mage::getModel('catalog/product')->load($productId);
$path = Mage::helper('catalog/image')->init($product, 'image')->resize(75, 75);
<?php $this->formatPrice(10);?>
echo $this->getLayout()->createBlock('sales/order_recent')->setTemplate('sales/order/recent.phtml')->toHtml();
Mage::app()->getStore()->getCurrentCurrencyCode();
Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
$customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping();
if ($customerAddressId){
$address = Mage::getModel('customer/address')->load($customerAddressId);
}
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
umask(0);
Mage::app();
// Secret Sauce - Initializes the Session for the FRONTEND
// Magento uses different sessions for 'frontend' and 'adminhtml'
Mage::getSingleton('core/session', array('name'=>'frontend'));
$session = Mage::getSingleton('checkout/session');
foreach ($session->getQuote()->getAllItems() as $item)
{
$productid = $item->getProductId();
$name = $item->getName();
$qty = $item->getQty();
echo "Product Id-".$productid.', Name-'.$name. ', Quantity-'.$qty;
}
<?php
print_r(get_class_methods(get_class($this)));
?>
or
<?php
print_r($this->debug());
?>
or
<?php
echo Zend_Debug::dump($this);
?>
<?php echo $this->getSkinUrl('') ?>
<?php echo $this->helper('checkout')->formatPrice(Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal()); ?>
<?php
$currentCategory = Mage::registry('current_category');
?>
16. Add product to cart through querystring:http://www.mydomain.com/checkout/cart/add?product=[id]&qty=[qty] http://www.mydomain.com/checkout/cart/add?product=[id]&qty=[qty]&options[id]=[value]
Mohan Natarajan Powered by Blogger