Pages

Wednesday, August 14, 2013

Remove Top Links in Magento

Just comment the top link block in the layout file

My Account
/app/design/frontend/Your-Interface/Your-Theme/layout/customer.xml

My cart and Checkout
/app/design/frontend/Your-Interface/Your-Theme/layout/checkout.xml

My Wishlist
/app/design/frontend/Your-Interface/Your-Theme/layout/wishlist.xml

To Display The Currency In Frontend in Magento

Currency In Dropdown format

In page.xml add the Block if not exist

<block type=”directory/currency” name=”currency” as=”currency” template=”directory/currency.phtml”/>

Template File

/app/design/frontend/template/Your_Interface/YOUR-TEMPLATE-NAME/template/directory/currency.phtml

To get the Currency Symbol in front end

<?php if($this->getCurrencyCount()>1): ?>

<?php foreach ($this->getCurrencies() as $_code => $_name): ?>

<?php echo Mage::app()->getLocale()->currency($_code)->getSymbol();?>

<?php endforeach; ?>

<?php endif; ?>

How to create Magento Module

In this tutorial, we will introduce the coding of Magento in the form of a “Hello World”-style module. The goal of the module will be simply to write some information to a log file every time a product is saved. This very basic module will allow us to cover a number of interesting topics, including:
The app/code directories,
The structure and creation of a Magento module,
Event observers,
Logging.
Before We Begin

This tutorial assumes that you already have an installation of Magento up and running, either locally or on a development server, that you can add new files to. The version of Magento that you use doesn’t really matter, because we will be covering fundamental aspects that exist across all versions and editions: Community, Professional and Enterprise.
Disable the Cache

This is one of the first lessons a Magento developer should learn: disable the cache! You can do this by going to Admin Panel > System > Cache Management > Select All > Actions: Disable > Submit.
While very good at boosting performance in a production environment, the cache is a developer’s enemy. Leave it enabled at your peril! Every Magento developer I have met has on more than one occasion spent an hour or so wondering why their latest update is not showing up, only to find that Magento is still displaying the version of the website that it conveniently cached earlier that day.
The app/code Directory

How to create Magento mobile site

Recent studies have shown that in the near future (by 2014) more people will use mobile devices ( iPod, iPhone, Tablet …) rather than computers, which can be a problem for the advancement of your business. Magento offers you an ideal solution how to overcome that problem. This tutorial will help you to install a mobile theme on your web site.
You can quickly and very easily create a storefront, which is suitable for mobile devices, so users can shop even when they aren´t near their computers.
Magento 1.7  uses HTML5 technology, which is supported by iPhone , Android, Opera Mini, iPod, Blackberry and many more.
HTML5 technology includes many out-of-the-box features, which give you many advantages such as:
• Specific video and audio media capabilities
• Simple search and results display
• Your display will be clean of product detail pages
• Swiping product images is very easy
• You can zoom in and zoom out
• Cross-sell and up-sell capabilities
• Drag-and-drop capabilities
If you want to activate the HTML5 mobile theme for Magento 1.7, you need to follow these instructions. There are only four steps in how to setup a mobile theme on your web site.


How to remove Shop by Options from the left bar in magento

In Catalog.xml

Please Comment following code
<!--<reference name="left"><block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
</reference>
-->

Sunday, August 11, 2013

To Change The Default Magento Logo

In ADMIN end
System -> Configuration->General->Design
Click on “Design” in the left side menu and open the “Header” section
Change the file name in the “Logo Image Src” to the file name you just uplaoded.Here you can also change the logo Alt message

Get Connection & Custom Query Execution in Magento

For database connection
$write = Mage::getSingleton('core/resource')->getConnection('core_write');

$qry=”Select * from tablename”;
$execute=$write->query($qry);
$fetch=$execute->fetch()
To get the Row Count
$count=$execute->rowCount();

Get Magento Urls in Phtml Page

Get Base Url :
Mage::getBaseUrl();
Get Store Url : 
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
Get Skin Url :
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
$this->getSkinUrl(‘images/imagename.jpg’);
Get Media Url :
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
Get Js Url : 
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
Get Current Url
Mage::helper(‘core/url’)->getCurrentUrl();
Get Home Url
Mage::helper(‘core/url’)->getHomeUrl();

Get Urls in Cms Pages or Static Blocks in Magento

Get Base Url :
{{store url=”"}}
Get Skin Url :
{{skin url=’images/imagename.jpg’}}
Get Media Url :
{{media url=’/imagename.jpg’}}
Get Store Url : 
{{store url=’mypage.html’}}

How to Call Magento Static Block in CMS Page and phtml in Magento

In PHTML
<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘yourblockid’)->toHtml(); ?>
IN CMS
{{block type=”cms/block”  block_id=”yourblockid“}}