Zend Anwar

Full stack web developer

Category: Magento

Magento

How to left Navigation Ascending order in Magento?

It is very simple. Please go to \app\design\frontend\default\<Your_theme>\template\catalog\navigation\left.phtml Just copy and paste. Hope it will work. If you have any query please comments.   <?php if (!Mage::registry(‘current_category’)) return ?> <?php $_categories = $this->getCurrentChildCategories() ?> <?php $_count = is_array($_categories)?count($_categories):$_categories->count(); ?> <?php if($_count): ?> <div> <div> <dl id=”narrow-by-list2″> <dt><?php echo $this->__(‘Category’) ?></dt> <dd> <?php    $temp = array(); […]

Read More

How to call all static page in Magento?

If you want to show all static pages in Magento Menu or any Landing Page. Just below Code copy and paste. Hope so it will work. If you have any query please comments.  <div> <?php $collection = Mage::getModel(‘cms/page’)->getCollection() ->addStoreFilter(Mage::app()->getStore()->getId());?> <?php  $collection->getSelect() ->where(‘is_active = 1’); ?> <ul> <?php foreach ($collection as $page): ?> <?php $PageData = […]

Read More

How to Sort product list by custom attribute in Magento?

Please open \app\design\frontend\default\<your theme name>\template\catalog\product\ toolbar.phtml Line number may be 63. just replace with below code : <fieldset> <?php //$this->_availableOrder = array(‘name’=>__(‘Alphabetical’), ‘price’=>__(‘Price’)); ?> <label><?php echo $this->__(‘Sort by’) ?></label> <select onchange=”setLocation(this.value)”> <option value=”<?php echo $this->getOrderUrl(‘featured’, ‘asc’) ?>”<?php if($this->isOrderCurrent(‘featured’) && $this->getCurrentDirection() == ‘asc’): ?> selected=”selected”<?php endif; ?>>Featured </option> <option value=”<?php echo $this->getOrderUrl(‘sku’, ‘asc’) ?>”<?php if($this->isOrderCurrent(‘sku’) && […]

Read More

How to get url in Magento?

 Get Base Url : Mage::getBaseUrl();  Get Skin Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); (i) Unsecure Skin Url : $this->getSkinUrl(‘images/imagename.jpg’); (ii) Secure Skin Url : $this->getSkinUrl(‘images/imagename.gif’, array(‘_secure’=>true));  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 Store Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); Get Current Url Mage::helper(‘core/url’)->getCurrentUrl(); Get Url in cms pages or static blocks  Get Base Url : {{store […]

Read More

How to decrease database size in Magento?

To decrease database size you take below action. It will not effect your database. You can say this is unwanted data. TRUNCATE dataflow_batch_export; TRUNCATE dataflow_batch_import; TRUNCATE log_customer; TRUNCATE log_quote; TRUNCATE log_summary; TRUNCATE log_summary_type; TRUNCATE log_url; TRUNCATE log_url_info; TRUNCATE log_visitor; TRUNCATE log_visitor_info; TRUNCATE log_visitor_online; TRUNCATE report_viewed_product_index; TRUNCATE report_compared_product_index; TRUNCATE report_event; TRUNCATE index_event; TRUNCATE catalog_compare_item; TRUNCATE catalogindex_aggregation; […]

Read More

How to edit, “Thank you for registering with Default Store View” in Magento?

This is very simple. Please follow the step Goto System > Manage Stores > Default Store View. Just edit the NAME field [default “main store”] and make it, whatever you need. Thats all. Hope it will work.  

Read More

How to Speed up Magento?

Please check below info to Speed up Magento: Speed up Magento with these simple admin settings. When you’re ready to go live with your Magento store, remember to setup your admin for maximum performance! These are the settings that will significantly speed up your Magento installation: 1. Most users are well aware of this one. […]

Read More

How to get filepath and url in Magento

base Mage::getBaseDir() base Mage::getBaseDir(‘base’) magento/ app Mage::getBaseDir(‘app’)  magento/app/ code  Mage::getBaseDir(‘code’)   magento/app/code design  Mage::getBaseDir(‘design’)  magento/app/design/ etc  Mage::getBaseDir(‘etc’)  magento/app/etc lib Mage::getBaseDir(‘lib’)  magento/lib locale Mage::getBaseDir(‘locale’)  magento/app/locale media Mage::getBaseDir(‘media’)  magento/media/ skin Mage::getBaseDir(‘skin’) magento/skin/ var Mage::getBaseDir(‘var’)  magento/var/ tmp Mage::getBaseDir(‘tmp’)  magento/var/tmp cache Mage::getBaseDir(‘cache’)   magento/var/cache log Mage::getBaseDir(‘log’)  magento/var/log session Mage::getBaseDir(‘session’)   magento/var/session upload Mage::getBaseDir(‘upload’)   magento/media/upload export Mage::getBaseDir(‘export’)  magento/var/export

Read More

How to setup Fedex in Magento shopping Cart?

Hello guys, I have been face to setup Fedex in Magento Shopping cart. I tried several times but failure due to incorrect Fedex information putted into admin panel. Here in this tutorial, you will know, how to setup FedEx Shipping Module in Magento Store. Step 1. Go to: Fedex Developer Resource Center and create developer’s […]

Read More

How to check You are in Home Page in Magento?

This is very simple just below code copy and paste in your .phtml file and run. <?php if($this->getUrl(”) == $this->getUrl(‘*/*/*’, array(‘_current’=>true, ‘_use_rewrite’=>true))): echo “Homepage”; else: echo “Not in Homepage”; endif; ?> Hope it will work.

Read More