Tuesday, 26 November 2013

How to speed up Magento


Many Magento issues are caused by slow performance. The recommended way to speed up Magento's performance is to enable its Compilation function.  The performance increase is between 25%-50% on page loads.
You can enable Magento Compilation from your Magento admin panel > System > Tools > Compilation.

How to reset Magento Admin Password


To change your Magento admin password, go to your cPanel > phpMyAdmin, select your Magento database, click the SQL tab and paste this query:
UPDATE admin_user SET password=CONCAT(MD5('sGnewpass'), ':sG') WHERE username='AdminUsername';
Note: You have to change newpass in the MD5('sGnewpass') with your new password, and change *AdminUsername* to your Magento admin username.
Execute the query by clicking the Go button and your password will be changed.

How to configure Magento to work with a new domain


There are two things you should do in order to configure Magento to work with a new domain:
  • Edit the Magento database
Go to your cPanel > phpMyAdmin. Select your Magento database from the  left menu, find the table called core_config_data and click on it. Click the Browse tab and edit the first two fields:
web/unsecure/base_urlweb/secure/base_url
by clicking the pen icon in front of each of them. Replace your old domain name with your new one and click the Go button to save the change.
  • Clear the Magento cache.
The Magento cache folder is located in your Magento installation directory > /var/cache. To clear the cache, simply delete the folder. 
Many Magento issues can be fixed just by deleting the cache.

How to disable the Compare products functionality


You can disable the Compare products functionality in Magento by following these steps:
  • Edit app/code/core/Mage/Catalog/Helper/Product/Compare.php and change the following code: 
public function getAddUrl($product){return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product));}
to
public function getAddUrl($product){//return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product)); return false;}
  • Edit ./app/design/frontend/base/default/layout/catalog.xml (if you are using a different Magento theme, enter its name instead of default) and change the following code:
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
to
<!-- <block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/> -->
  • Flush the Magento cache from your Magento admin area > System > Cache Management.

 

How to change orderno from 10000* to new



With this code your order no will be started from 1001. If  you want to add prefix then you can add
eav_entity_store.increment_prefix='ABC' you have to add length to.

update eav_entity_type set increment_pad_length=4 where entity_type_code='order';
update eav_entity_store inner join eav_entity_type on eav_entity_type.entity_type_id = eav_entity_store.entity_type_id set eav_entity_store.increment_last_id='1000',eav_entity_store.increment_prefix='' where eav_entity_type.entity_type_code='order';

update eav_entity_type set increment_pad_length=4 where entity_type_code='invoice';
update eav_entity_store inner join eav_entity_type on eav_entity_type.entity_type_id = eav_entity_store.entity_type_id set eav_entity_store.increment_last_id='1000',eav_entity_store.increment_prefix='' where eav_entity_type.entity_type_code='invoice';

update eav_entity_type set increment_pad_length=4 where entity_type_code='shipment';
update eav_entity_store inner join eav_entity_type on eav_entity_type.entity_type_id = eav_entity_store.entity_type_id set eav_entity_store.increment_last_id='1000',eav_entity_store.increment_prefix='' where eav_entity_type.entity_type_code='shipment';

update eav_entity_type set increment_pad_length=4 where entity_type_code='creditmemo';
update eav_entity_store inner join eav_entity_type on eav_entity_type.entity_type_id = eav_entity_store.entity_type_id set eav_entity_store.increment_last_id='1000',eav_entity_store.increment_prefix='' where eav_entity_type.entity_type_code='creditmemo';