Please follow the below steps :

1) Add the below script in the app/design/frontend/your theme/default/template/catalog/product/list/toolbar.phtml

<script>   
    jQuery(document).ready(function(){
        if(!jQuery('#current').length){
           
            jQuery("body").append('<input type="hidden" name="current"  id="current" value="1" />');
            jQuery("body").append('<input type="hidden" name="next"  id="final" value="<?php echo $this->getLastPageNum();  ?>" />');
           

            jQuery(window).scroll(function(event){
                setTimeout(function()
                {
                    var current_val=parseInt(jQuery("#current").val());
                    var final_val=parseInt(jQuery("#final").val());
                    var next_val=parseInt(current_val)+1;

                    if(final_val>current_val){
                        jQuery("#ajax-load").css("display","block");
                        jQuery.ajax({
                            url: "<?php echo $this->getPagerUrl(); ?>?p="+next_val,
                            async:false,
                            success: function(html){
                                var $result = jQuery(html).find('.products-grid').children();                   
                                jQuery(".products-grid").append($result);
                                jQuery("#ajax-load").css("display","none");
                                jQuery("#current").val(next_val);                               
                            }
                        });
                    }
                });
            });       
      }
               
    });
</script>

2) Add image tag to show ajax loader in the app/design/frontend/ultimo/default/template/catalog/product/list.phtml path

<div id="ajax-load" style="display:none"><img src="<?php echo $this->getSkinUrl('images/ajax-loader.gif', array('_secure'=>false)); ?>" /></div>
Reference : http://excellencemagentoblog.com/blog/2012/12/15/magento-multiple-website-login/

Get Current store id

$storeId = Mage::app()->getStore()->getId();


Load product

$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->load($key);

-- first our items table:
CREATE TABLE `items` ( `id` int(11) NOT NULL auto_increment, `item_name` varchar(50) default NULL, PRIMARY KEY (`id`) );
-- now our item attributes
CREATE TABLE `item_attributes` ( `id` int(11) NOT NULL auto_increment, `item_id` int(11) NOT NULL default '0', `attribute_name` varchar(50) default NULL, PRIMARY KEY (`id`), KEY `item_id_attribute_name` (`item_id`,`attribute_name`) );
-- now finally our attribute values
CREATE TABLE `attribute_values` ( `attribute_id` int(11) NOT NULL default '0', `attribute_value` varchar(100) default NULL, UNIQUE KEY `attribute_id` (`attribute_id`,`attribute_value`) );
Step 1:

$attributes = array('name'=> $name'store_id'=> store_id);

$model = mage::getmodel('module/modelname')->loadbyattributes($attributes);

Step 2:

public function loadbyattributes($attributes)

{

$this->setdata($this->getresource()->loadbyattributes($this,$attributes));

return $this;

}

Step 3:

public function loadbyattributes(Custom_Ccms_Model_Ccms $ccmsObj, $attributes)

{

$adapter = $this->_getreadadapter();

$where = array();

foreach ($attributes as $attributecode=> $value) {

$where[] = sprintf('%s=%s', $attributecode, '"'.$value.'"');

}

$select = $adapter->select()->from($this->getmaintable())->where(implode(' and ', $where));

$binds = $attributes;

$id=$adapter->fetchOne($select,$binds);

if($id){

$this->load($ccmsObj, $id);

}

return $this;

}

Reference : https://huztechbuzz.wordpress.com/2014/04/26/complete-list-of-all-events-in-magento/
Module name

Mage::app()->getRequest()->getModuleName();

Route name

Mage::app()->getRequest()->getRouteName();

Controller name

Mage::app()->getRequest()->getControllerName();

Action name

Mage::app()->getRequest()->getActionName();

Consider extension 'Redirect Visitors by Country IP'

  • Get this extension key from the http://www.magentocommerce.com/magento-connect/redirect-visitors-by-country-ip.html
  • Go System -> Magento connect -> Magento Connect Manager
  • Paste your extension key in the 'Paste extension key to install' text box and click instal button
  • After clicking install button, you can view 'Extension dependencies' table with 'Cancel installation' and 'Proceed' button
  • Click the 'Proceed' button.
  • Now you can see the 'black' section at the end of the 'Magento connect Manager' page in which you see installing progress
  • After you getting 'cache cleaned successfully' message in 'black' section, click refresh button
  • Now logout admin panel and login.
  • Now you can this extension in your admin panel.
  • Thanks for viewing this post
1. Go System -> Permissions -> Roles
2. Give Role Name in the 'Role Name' Text field.
3. Select 'Custom' from the Resource Access drop-down and select 'CMS' from the list of resources
4. In First three steps, we created Roles and selected resources to those role.
5. The next steps explain about create user from admin and assign Role to those user.
6. Go System -> Permissions -> Users
7. Give Information of Username,email... in the Account Information form
8. Then select newly created role from the list of roles.
Reference: http://magento.stackexchange.com/questions/8444/how-to-get-shipping-address-by-shipping-address-id
Reference: http://www.w3bdeveloper.com/how-to/how-to-get-customer-address-in-magento-by-cutomer-id/
Reference : http://www.arscommunity.com/wiki/magento/default-address-for-shipping-estimation
$product = Mage::getModel(“catalog/product”)->load($product_id);
$theoptions = $product->getOptions();
foreach($theoptions as $opkey=> $opval)
{
echo $opval->getOptionId().’|’.$opval->getTitle();
}
Reference : http://inchoo.net/magento/adding-a-new-language-in-magento/ Norwegian Nynorsk Language Pack : http://www.magentocommerce.com/magento-connect/magento-community-modules-norwegian-nynorsk-norway-language-pack.html Norwegian Bokmal Language Pack : http://www.magentocommerce.com/magento-connect/magento-community-modules-norwegian-bokmal-norway-language-pack.html
Reference : http://www.daffodilsw.com/blog/integrating-magento-header-footer-in-wordpress-solved
Reference Url :
http://stackoverflow.com/questions/4270490/how-do-i-get-a-website-switcher-instead-of-store-switcher
http://www.magentocommerce.com/boards/viewthread/8296/



  • Magento provide support to create own magento log files.It have the function for this purpose in
    • app/code/Mage.php
  • public static function log($message, $level = null, $file = '') {}
  • We just need to call the above function when we need to create log file or storing information in custom log files.
    • For example:
    • Mage::log('My log entry', null, 'mylogfile.log');

Get store data
Mage::app()->getStore();
Store Id
Mage::app()->getStore()->getStoreId();
Store code
Mage::app()->getStore()->getCode();
Website Id
Mage::app()->getStore()->getWebsiteId();
Store Name
Mage::app()->getStore()->getName();
Is Active
Mage::app()->getStore()->getIsActive();
Homepage URL of Store
Mage::app()->getStore()->getHomeUrl();
Current page URL of Store
Mage::app()->getStore()->getCurrentUrl();

All of these functions can be found in class Mage_Core_Model_Store
File: app/code/core/Mage/Core/Model/Store.php
Reference : http://www.techdilate.com/code/magento-get-current-store-details/
Reference: http://www.w3bdeveloper.com/how-to/magento-get-products-from-order-by-order-id-as-array/
Reference : http://ecommerce.eglobeits.com/blog/remove-magento-navigation-links-from-my-account-dashboard/








Coming soon...

To add additional column to your grid and add custom renderer, you need to open your grid block from required module. Let me explain with custom module to add additional column.

My custom module Structure

  • Custom
  • -Sample
  • --Block
  • ---Adminhtml
  • ----Sample
  • -----Grid.php

We need to work on the Grid.php file.This file contains different type of functions to display content in the grid.We need to search _prepareColumns() functions and work on that..

I already contain some columns to display informations.First I will show one from this grid.

For Example : ------------ We have to see how do add image in the admin grid.

Open Grid.php and search _prepareColumns() functions.Now we need to add one column .Paste the following line in this function.

$this->addColumn('image', array(
'header' => Mage::helper('sample')->__('Image'),
'align' => 'left',
'width' => '100px',
'index' => 'filename', // variable name of the image.This field information comes from modal.
'renderer' => 'Custom_Sample_Block_Adminhtml_Sample_Renderer_Image',
'attr1' => 'value1' // We don't use this now
));

I already told about my custom module structure.Now we need to create one 'Renderer' folder within Sample Block folder,and create one 'Image.php' file within Renderer folder

  • Custom
  • -Sample
  • --Block
  • ---Adminhtml
  • ----Sample
  • //Block
  • -----Renderer
  • ------Image.php
  • -----Grid.php
Now open Image.php And add the following files
class Custom_Sample_Block_Adminhtml_Sample_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract{
public function render(Varien_Object $row)
{
$html = '<img ';
$html .= 'id="' . $this->getColumn()->getId() . '" ';
$html .= 'src="' . Mage::getBaseUrl('media').$row->getData($this->getColumn()->getIndex()) . '"';
$html .= 'class="grid-image ' . $this->getColumn()->getInlineCss() . '"/>';
return $html;
}
}
Reference:
  • http://inchoo.net/magento/how-to-add-custom-renderer-for-a-custom-column-in-magento-grid/
  • https://nikunjvadariya.wordpress.com/2013/06/13/magento-adding-thumbnail-image-to-magento-admin-grid-column/

To add additional column to your grid, you need to open your grid block from required module. Let me explain with custom module to add additional column.

My custom module Structure

  • Custom
  • -Sample
  • --Block
  • ---Adminhtml
  • ----Sample
  • -----Grid.php

We need to work on the Grid.php file.This file contains different type of functions to display content in the grid.We need to search _prepareColumns() functions and work on that..

I already contain some columns to display informations.First I will show one from this grid.

$this->addColumn('title', array(
'header' => Mage::helper('sample')->__('Title'),
'align' =>'left',
'index' => 'title',
));

addColumn function create one column with 'Title' title in grid.The following details give the used variable's information.

  • 'title' => column name
  • 'header'=> Column Title
  • 'align' => Alignment of the this cloumn text
  • 'index' => Here i added 'title'.This is not static content. This is one cloumn value of this modal.We displayed title of the particular row's information,here we didplayed retireved information.

Now I like to show additional column.Here we display the description of this row.We already store description to this item.

Paste your existing column action and paste next to the existing column and edit column name to 'description'

$this->addColumn('description', array(
'header' => Mage::helper('sample')->__('Title'),
'align' =>'left',
'index' => 'title',
));

Edit the column title in the header variable in array

$this->addColumn('description', array(
'header' => Mage::helper('sample')->__('Description'),
'align' =>'left',
'index' => 'title',
));

Finally update index variable in array. We used 'item_description' to store the description of the item in table. Now we need to use this name 'item_description' in 'index' variable.

$this->addColumn('description', array(
'header' => Mage::helper('sample')->__('Description'),
'align' =>'left',
'index' => 'item_description',
));

After adding this description column, we can see new column with 'Description' Title in the admin grid.

Reference:

https://nikunjvadariya.wordpress.com/2013/06/13/magento-how-to-add-new-action-in-row-at-admin-grid-in-magneto/

When developing or customizing existing themes,you need to know template path hints for frontend and admin area.

Magento provide default option to see the template for the frontend (enable it via System > Configuration > Developer > Debug > Template Path Hints )

Unfortunately Magento doesn't provide same trick to the admin area.

Here you can see the trick to find admin temaple area with simple custom module

Download and install module from the below links

Download Link

After install custom theme, Clear cache and loggedin admin area again.Then enable template path hint from system configuration,you can view template path hints for both frontend and admin area.

This topic explains about getting category images in the frontend ( category list page ) and resize the image to the given size.

  • Call the below function from your template

  • Override category model(category.php) in the below directory
    • app/code/local/Mage/Catalog/Model/
  • Add the below function in category.php

For example :

We need to override category.php model file of the catalog module

  • Catalog module is placed in the core/Mage directory. Now here override the model file of the category.php
  • Create the following directory and files in local direcoty
    • app/code/local/Mage
    • app/code/local/Mage/Catalog
    • app/code/local/Mage/Catalog/Model
    • app/code/local/Mage/Catalog/Model/category.php
  • Now Open category.php file from this path ( core/Mage/Catalog/Model/ )
  • Copy the content of this file
  • paste copied content in new category file that is placed in this file path( local/Mage/Catalog/Model )
  • Now you can add new action or edit existing action in this model file.
Reference : http://stackoverflow.com/questions/14577006/changing-order-of-shopping-cart-totals-in-magento This site templates : http://www.freshdesignweb.com/free-responsive-blogger-templates.html