Magento: Get Product by SKU

Here is a quick code to get product information with SKU value. Get product information by sku // Get product by sku $sku = "microsoftnatural"; $product = Mage::getModel('catalog/product') ->loadByAttribute('sku', $sku); // print product data echo "<pre>"; print_r($product->getData()); echo "</pre>"; Get product id by sku $productIdBySku = Mage::getModel('catalog/product') ->getIdBySku('microsoftnatural'); echo $productIdBySku; Hope it helps. Thanks.

Magento: Solution for Google Analytics not tracking website

I had an old version of Magento. I had enabled google analytics tracking from Magento admin. But, google analytics was not tracking my webshop. The main reason behind this was that Google had modified its analytics tracking code and the GoogleAnalytics core module of Magento had old tracking code. To fix this issue, do the … Read more

Magento: Get all attributes & attribute name value of a product

Here is a quick code to get all attributes and their name and value associated with any particular product. First of all we have to load the product by it’s ID. And then get all it’s attributes. Here is the code:- $productId = 52; $product = Mage::getModel('catalog/product')->load($productId); $attributes = $product->getAttributes(); Get Name and Value of … Read more

Magento: Step-by-Step Moneybookers Payment Method Setup

This article shows step-by-step guide to setup Moneybookers (Skrill) Payment Method on Magento. I will be dealing with the developer perspective (creating and testing with a Test account). 1. Create Test Accounts You have to create two test account. One is Merchant/Business Account and the other is Personal Account. Use two different email address for … Read more

Magento: Installing New Language Package [Step-by-Step Guide]

Here is the step-by-step procedure to install new language package on Magento. Let’s assume that you want to install Dutch language package. 1. Go to this link. 2. Get the extension key. 3. Login to Magento admin 4. Go to System -> Magento Connect -> Magento Connect Manager 5. Install your desired language package 6. … Read more

Magento Paypal: Email, Shipping Cost & Order Status issue in version 1.4.0.1

Magento version 1.4.0.1 has some issues with Paypal email, shipping cost and order status. Note: All these issues occur when payment is done through Paypal 1. Order confirmation email is not sent Fix: – Open app/code/core/Mage/Checkout/Model/Type/Onepage.php – Go to line 626 – Comment out the IF condition as below: /** * we only want to … Read more

Magento: Incorrect template design for login and register page due to Persistent Shopping Cart

Problem: I am using Magento 1.6 and my login and register page design has problem. It is not taking the template path from my custom theme. Instead, it is taking the template path from base persistent folder. For example, the login template path is taken from frontend/base/default/template/persistent/customer/form/login.phtml instead of frontend/default/MY_THEME/template/customer/form/login.phtml It’s strange how this persistent … Read more

Magento: Overriding / Rewriting Mysql4 and Resource Eav Collection Class

Here is a tip to override/rewrite Mysql4 and Resource Eav collection class. I will only be including the config xml code. You can read more about Model Overriding over here: Magento: Model Controller Block Helper Override By Mysql4 Collection Class, I mean like the following class: Mage_Sales_Model_Mysql4_Order_Collection Overriding Mysql4 Collection Class <global> <models> <sales_mysql4> <rewrite> … Read more