Posts Tagged "Magento1"

Load product in magento by SKU or product id

To load product using product id we can use below code. $product = Mage::getModel(‘catalog/product’)->load($product_id); We can also load product using SKU. Below is the code for load product using SKU. $_sku = ‘product_sku’; $_product = Mage::getModel(‘catalog/product’)->loadByAttribute(‘sku’,$_sku); echo $_product->getName();

Read More

Direct SQL Queries In Magento

Let’s assume we need to fetch data from direct database and we don’t want to use model in magento. At that time we can also access data direct from database using magento database connection and simple SQL query. Below is…

Read More

Get product image in Magento

Magento basically have 3 different types of product image which are as followed. Base Image Small Image Thumbnail image Now let’s see how we can get product images using product id. $products = Mage::getModel(‘catalog/product’)->load(900); echo $products->getImage(); echo $products->getSmallImage(); echo $products->getThumbnail();…

Read More

Get product collection filter by category id in magento

Below is the code by using we can get product collection filter by category id in magento $category = Mage::getModel(‘catalog/category’)->load(‘category_id’); $productCollection = $category->getProductCollection(); $productCollection ->addStoreFilter() ->setVisibility(Mage::getSingleton(‘catalog/product_visibility’)->getVisibleInCatalogIds()) ->addMinimalPrice() ->addFinalPrice() ->addTaxPercents() ->addAttributeToSelect(Mage::getSingleton(‘catalog/config’)->getProductAttributes()) ->addUrlRewrite();

Read More

Get subcategories of a main category in magento

To insincere sales it is important that your store must be user friendly where user easily find his/ her needed product and easily navigate in store. one of important page in magento is to display subcategory of main category. i.e…

Read More

Filter product collection with multiple SKU magento

Suppose, you need product information of more then one product using SKU at that time we can get all information using “array in” with filter. Below is code for the same. you just need to change SKU name in below…

Read More

Update database password in magento

Changing database password frequently is always good practice to make your store secure and it will protract your store with malware and other hacking attacks. Below are the steps how to change database password in magento. 1) Connect to your…

Read More

How to change admin url in magento

By default we can access magento admin by simple using /admin after magento store URL. To secure your store its preferable that you change default URL of Magento store. Below are the steps to change admin url in magento. 1)…

Read More

Add top links in magento

Magento is an ecommerce platform built on open source technology and which use MVC system. It is managing all request response using Model, View and Controller. So, all view file call base on controller mapping as per there configuration in…

Read More

Magento get login customer information

Suppose we want to get all information of login User like Full Name, First Name, Middle Name, Last Name etc. We can also check user registration date, Date of Birth and many more information. Below is code to display information…

Read More