Solved

Search for customers in Magento

Posted on 2013-01-16
2
215 Views
Last Modified: 2016-03-02
This may seem like a silly question but here goes:

I need search for customers based on the first and last line of their address. the current search in Magento doesnt retrieve data based on address so I was wondering if there is way to modify the search to include addresses.

Based on the results I would like to populate a form field with customer details* <== I hope

Does anyone know of a good extension or are willing to share some ideas...?
0
Comment
Question by:rafique12
2 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 38782980
you can do something like:

$customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
if ($customerAddressId){
       $address = Mage::getModel('customer/address')->load($customerAddressId);
if(strpos($address->getData(), 'address-you-are-looking')){

}
}

Open in new window


Magento customer address
0
 

Author Comment

by:rafique12
ID: 38783156
Thanks for the reply^

Where would I include this? I'm still learning Magento as you can probably tell but I need to have a form with name, address, email etc fields that I can fill with the result of the search query...

I guess I need a starting point to build from if you can help?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question