Tuesday 5 May 2015

Yii - Features of the advanced template

  1. Pre-defined schema for the user table
  2. User login and registration forms
  3. Forgot password functionality
  4. Separate frontend and backend domains
  5. Automatic code generation for models, controllers, and views
  6. Built-in integration with Twitter Bootstrap and mobile first design
  7. Robust widgets and helpers for data presentation

Monday 6 April 2015

How to remove decimal values from price?

 For this, you need to edit code/core/Mage/Directory/Model/Currency.php

    Open  code/core/Mage/Directory/Model/Currency.php
 
   Find the following :-

 public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
    {
        return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);
    }


on line no 194 change this code to:-

 public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
    {
        return $this->formatPrecision($price, 0, $options, $includeContainer, $addBrackets);
    }

0 - Denotes the precision point for price..

But wait, you are still not done. The most important thing is still left.
- Clear the Cache.
- Go to System –> Cache Management
- Refreh Cache.
- If you have not enabled the Cache OR if it didn’t work even after refreshing the cache, then
- delete the cache folder present inside var (var/cache)





Friday 6 March 2015

Set Default Quantity to 1 in Magento

By default, the quantity box on the product page is always blank and that is not very user friendly. It would be great if the box would be set to "1" by default .

Now this can be done without any programming – only through configuration changes in the backend as follows:

    Go to Admin Panel -> System -> Configuration -> Inventory-> Product Stock Options from the Menu
    Click on Add Minimum Qty button (next to Minimum Qty Allowed in Shopping Cart option)
    Choose Customer Group: ALL GROUPS as you want this to be applied to all users
    Enter 1 for Minimum Qty
    Save Config

Display banners for category page

Step 1: Create static block.
Login to the magento admin panel and click on “CMS > Static blocks” and create new static block.
Just remember the name of static block here ;).

Step 2: Assign static block to the category.
Once the step 1 is complete go to the “Catalog > Manage Categories”. Select/ Click the category from left menu. It will reload the right hand panel data. Select “Display Settings” tab from right hand panel.
Now change
I) “Display Mode” drop down value “product only” to “static block and prodcut”.
II) Now select the cms block from drop down list of “CMS Block” field and click on save category button.

Now go to front-end and select the category page for whom you have just set the cms block. It will show you banner at the top of product list.

Thursday 3 July 2014

How to install and use Magmi for Magento?

The benefits of Magmi:
  • Super fast, direct SQL import.
  • Enhanced features (simple and advanced imported products)
  • Multiple storeviews and Websites possible
  • Import and update: categories, images, pricing, stock, .... (not bundled)
  • Translations of products at store level view
Installation and configuration:
The installation from Magmi is very simple. Magmi is a standalone plugin completely beside your Magento installation. It interacts directly with your Magento database.So, extract the Magmi folder in the root folder of your Magento installation. Create now the following folders in your Magento root folder:
  • /var/import (directory to import csv files)
  • /media/import (directory for the import of product images)
Visit the magmi configuration page: http:// <magento-url> /magmi/web/magmi.php
Now you only have to make the database configuration of your Magento site in Magmi, fill out and save. All other parameters are standard to use if you have followed the above folder structure.


Step 1:  product import:

The item processors are very useful plugins to do an advanced import. Check this item processors for our first product import:
  • On the fly category creator / importer (allows for category titles instead of IDs to use)
  • Image processing attributes (corresponding import product images)
You can also check all plugins to avoid problems.

CSV example:

sku;name;price;qty;is_in_stock;visibility;image;weight;categories;tax_class_id
demo-001;"Demo 1";12;19;1;4;demo.jpg;0;"demo categorie";2


Save generated csv file in the directory /var/import from magento and optionally post the image demo.jpg in the /media/import folder, you can select the csv file from the Data Sources tab of the Magmi imports page. Select the imported file from the dropdown, use ‘;’ as separator and " as enclosure. Go to the top of the 'Run magmi' tab and select "Create new items, new ones skip” and click Run.

When the import is successful you get a summary of the statistics from your import. You will get a list of error messages, when there is an import problem.
Go to the Magento backend and check if your first product was added to Catalog > Manage Products.
To view your product in the frontend, you need to re-index magento: System > index management.
 This simple import is done with the minimum data required in magento. Just a list of parameters:
  • SKU (unique number of a product)
  • name (title of your product)
  • price (price of your product)
  • Qty (quantity of products in stock)
  • is_in_stock (0 for no or 1 for yes, 1 is necessary to visualize your product in the shop)
  • visibility (4 for visibility in catalog and search)
  • Image (url of the image which is placed in the /media/import directory)
  • weight (weight can be 0 if you do not use it in your shop)
  • categories (the name of the category, if it does not exist it is created by the "on the fly category creator" plugin "demo/demo” to import in a subcategory)
  • tax_class_id (2 for products with taxes or use a self-configured value)

Advanced product imports:

This more advanced import allows you to use almost all parameters inside your Magento site.

A closer look to use some additional parameters:
  • store (default "admin" or a storeview to make translations possible. You can overwrite the title and description from "admin" at store level view).
  • websites (default "base" or the code of the Web site where you want to add the products, only to be used for a Magento installation with multiple sites)
  • attribute_set ('Default' or a self-generated code for a product with special attributes)
  • Type (default 'simple' or 'configurable' to import configurable products)
  • media_gallery (add extra images in addition to the standard picture)
  • See also the most common attribute codes within magento: http://go.magento.com/support/kb/entry/name/working-with-product-csv-files

Wednesday 18 June 2014

Exception printing is disabled by default for security reasons

Error :
Exception printing is disabled by default for security reasons.
Error log record number: XXXXXXXXXXXXXXX
Solution :

After installation of magento then some of pages shows this error.
Exception printing is disabled by default for security reasons.
Error log record number: XXXXXXXXXXXXXXX

In this case you need to check following steps.
1) Go to folder /home/username/public_html/errors/
2) cp -p local.xml.sample  local.xml
3) vi /home/username/public_html/lib/Zend/Cache/Backend/File.php
and search

protected $_options = array(
'cache_dir' => 'null',


and Change it to:

protected $_options = array(
'cache_dir' => 'tmp/',
Save the changes.


Create “tmp” folder under “/home/username/public_html/” folder.

Thats all! done

How can I remove index.php from url in magento ?


If you want to access your magento URL without index.php for example:

http://domain.com/index.php/category
to
http://domain.com/category

then use the following steps

1) Login to admin section by using the URL
http://domain.com/index.php/admin

2) then go to “System >>  Configuration >>Web >> Search Engines Optimization”
Use Web Server Rewrites : YES

3) Go to “System >>  Configuration >>Web >>Secure”
Use secure URL Frontend: YES

4)Then create the .htaccess file under your the magento installed folder.

If the magento installed under document root ( /home/username/public_html) then add follogig rules into .htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


and If the magento installed under /shop or directory then add the following rules into ” /home/username/public_html/shop/.htaccess ” file.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /shop/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /shop/index.php [L]
</IfModule>


Done