Magento Themes and Magento Extensions

How long customer is inactive ?

Posted on January 17th, 2013 | Posted by admin

How long customer is inactive ?

1 $customer = Mage::getSingleton('customer/session')->getCustomer();
2 $log = Mage::getModel('log/customer')->load($customer->getId());
3 $inctive_time = now() - $log->getLastVisitAt();

Magento – Add a new tab on customer edit page

Posted on October 24th, 2012 | Posted by admin

This version touches core files. Please make backup before you get started.

In Magento: I am going to add ‘Survey’ tab and display text

1. Open /app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php
Inside _beforeToHtml() method, add the following code

1 $this->addTab('Survey',array(
2 'label' =>Mage::helper('customer')->__('Survey'),
3 'class' => 'ajax',
4 'url' => $this->getUrl('*/*/survey',array('_current'=>true)),
5 ));

Magento – How to add/remove link(s) in customer account dashboard?

Posted on September 16th, 2012 | Posted by admin

In this post you can see how to add a new link to customer account navigation menu from custommodule.xml. Layout XML files can be found in app/design/frontend/[package]/[theme]/layout. Each Magento module may define its own layout XML file. Add secure link for example.

	<reference name="customer_account_navigation">
            <action method="addLink" translate="label" module="custommodule"
                <label>My Custome Label</label>

Uses the secure domain if allowed in configuration


get collection of customer all address in magento

Posted on September 15th, 2012 | Posted by admin

get collection of customer all address in magento

Use the following code to retrieve all address of customer with the help of its email id.

$websiteid = Mage::app()->getwebsite->getid();
$store = Mage::app()->getStore();

$customer = Mage::getModel(“customer/customer”);
$customer->website_id = $websiteid;
$address = Mage::getModel(“Customer/Entity_Address_Collection”);

How to Add Custom Tabs to Magento Customer Edit page

Posted on February 3rd, 2012 | Posted by admin

Magento Provides the manage customers feature to list and edit the customers information.
The Customer edit page in the admin panel gives details about the customers account information,address,orders etc.

In some scenarios we may need to show our custom module contents related to the customer in a additional tab. To achieve this functionality we need to create a custom module and add our tab.

Step 1: We start with our config.xml file. In this file we are specifying an adminhtml xml layout file and a Block class for our custom module.


Page 1 of 212»