$_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
Magento Code
Explore magento tutorials, magento guide, magento faqs, magento help, magento development, magento tips and tricks and everything related to magento.
Monday, October 1, 2012
Magento Get Product ID from SKU
Load magento product by its sku. This is the fastest way to get product by sku.
Wednesday, August 29, 2012
How to reset Magento admin password
If you need to change your magento admin password, go to phpMyAdmin, select your Magento database, click the SQL tab and paste this query:
You have to change newpass in the MD5('sGnewpass') with your new password, and change 'AdminUsername' to your Magento admin username.
Execute the query and your password will be changed.
UPDATE admin_user SET password=CONCAT(MD5('sGnewpass'), ':sG')
WHERE username='AdminUsername';
You have to change newpass in the MD5('sGnewpass') with your new password, and change 'AdminUsername' to your Magento admin username.
Execute the query and your password will be changed.
Tuesday, August 28, 2012
Enable Search Engine Friendly URLs in Magento
To enable Search Engine Friendly URLs in Magento, you have to log in to the Magento admin area and click on the Configurations button. Under the System navigation menu, go to Web page from the sub-navigation panel on the left.
Click on the Search Engines Optimization tab and turn on the Use Web Server Rewrites (mark as Yes). Click on the Save Config button and your Magento SEF URLs will be enabled.
Click on the Search Engines Optimization tab and turn on the Use Web Server Rewrites (mark as Yes). Click on the Save Config button and your Magento SEF URLs will be enabled.
Saturday, August 25, 2012
Remove Estimate Shipping and Tax box
If you need to remove the Estimate Shipping and Tax from shopping cart page on magento, follow these instructions:
Open /app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/cart.phtml file
Find the line that mentions shipping
Delete it and save file.
Clear cache and refresh page to see result.
Open /app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/cart.phtml file
Find the line that mentions shipping
Delete it and save file.
Clear cache and refresh page to see result.
Friday, August 24, 2012
Magento Print Collection Query
There come several situations where you need to print the collection query in magento and here is the way how to print collection query:
Print Collection Query
Print Collection Query
$collection->printLogQuery(true);
Subscribe to:
Posts (Atom)