Skip to main content

Posts

Magento Multiple Store Setup

Many times we need to create multiple stores in magento website. In magento we create different stores to make it more local. We can access different stores using below ways: 1) Domain (e.g. www.store1.com and www.store2.com) 2) Subdomain (e.g. store1.mystore.com and store2.mystore.com) 3) Folder (e.g. mystore.com/store1/ and mystore.com/store2/) Its all upto to you which way you prefer. For all these we need to follow below steps: Step 1: Add new Magento store: It might be possible that both store have different  catalogue so to manage this. We need to make two different Base Categories. To create a new base category follow below steps: Log in to your Magento admin panel. Go to Catalog -> Manage Categories . If you want both your websites to share same “ Default Category ”, select it by clicking on it on the left. Or click Add Root Category to create a new root category different from the existing one. Once the category is selected, under the Gene...

Memcache with Magento : Magento speed like Rocket

Hi Fellas, I am sharing this article showing how we can use the power of memcache alnog with magento. One of major magento drawback would be its speed, although we can several ways to speed up. Memcache is good option as its new and fast. Before starting lets know a bit about what is memcache. Memcache is used to fast access database, api and etc. For this it uses some space on server. For more information please visit: http://www.memcached.org/ You can use below method to apply memcache for Magento v1.9 and older. Below are the steps for starting memcache on your magento store: 1) Go to app/etc/ and find local.xml file. 2) Find the </global> tag and paste below code before the tag. <cache> <cache>     <backend>memcached</backend>     <slow_backend>database</slow_backend>     <fast_backend>Memcached</fast_backend>     <fast_backend_options>  ...

Magento Speed Optimization

E-commerce website needs to so fast that customer need not have to wait much. In current scenario time is very important aspect for an e-commerce store. Below I will let you know how you speed up your online store and increase your website performance. 1) Minify JS and CSS: Website have so many js and css. It takes alot of time to load the home page. It will give a bad impression if website home page took long to open. We need to minify JS and CSS of magento store. For merging CSS files: 1) Login into magento admin panel. 2) System -> Configuration -> Developer -> Merge CSS files For merging JS files: 1) Login into magento admin panel 2) System -> Configuration -> Developer -> JavaScript setting -> Merge JavaScript files 2) Gzip Compression: Gzip compresses web pages and stylesheets at the server level before sending them over to the browser. <IfModule mod_deflate.c> # Compress HTML, CSS, JavaScript, Text, XML and fonts AddOutputFilterBy...

Magento - Get product by sku

Hi Everybody, I was working with magento products and found that how we can find product object using sku and I have found below solution. // Here $sku is our sku variable for product. $sku = 'A1001' ; //loadByAttribute function is helpful for getting product data $product = Mage:: getModel ( 'catalog/product' ) -> loadByAttribute ( 'sku' , $sku ) ;

Angular JS Table Filter and Sorting

Hi All, I am new to angular js and doing some random stuff. I am sharing the code here. Hope this will help you some where. <style> table, td  {   border: 1px solid grey;   border-collapse: collapse;   padding: 5px; } .sortorder:after {   content: '\25b2'; } .sortorder.reverse:after {   content: '\25bc'; } </style> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <body> <div ng-app="myApp" ng-controller="customersCtrl"> <table>     <tr>         <td ng-click="order('Name')">           Customer Name           <span class="sortorder" ng-show="predicate === 'Name'" ng-class="{reverse:reverse}"></span>         </td>     ...

Add/Update product attribute using CSV in Magento

Hi All !!! As per my last post we have updated customer group prices in these I am sharing code to add/update product attributes whether its a custom or default attribute. Have a look at the code: <?php //Upload File if (isset($_POST['submit'])) {     if (is_uploaded_file($_FILES['filename']['tmp_name'])) {         echo "<h1>" . "File ". $_FILES['filename']['name'] ." uploaded successfully." . "</h1>";     }     //Import uploaded file to Database     $handle = fopen($_FILES['filename']['tmp_name'], "r");     $i=0;     while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {         if($i>0) {             $si = Mage::getModel('catalog/product')->loadByAttribute('sku',$data[0]);            ...

Add/Update Customer group product price using CSV in Magento

Hi Guys!!! After a long time I am back on posting. While working on a project I came with a problem of updating customer group pricing in magento using CSV. Well not  a big problem, let first discuss the logic. There are two tables in magento updates when you add customer group price: 1) catalog_product_index_group_price 2) catalog_product_entity_group_price So here is the code <?php //Upload File if (isset($_POST['submit'])) {     if (is_uploaded_file($_FILES['filename']['tmp_name'])) {         echo "<h1>" . "File ". $_FILES['filename']['name'] ." uploaded successfully." . "</h1>";         //readfile($_FILES['filename']['tmp_name']);     }     //Import uploaded file to Database     $handle = fopen($_FILES['filename']['tmp_name'], "r");     $i=0;     while (($data = fgetcsv($handle, 1000, ",...