Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7817475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:14:03+00:00 2026-06-02T06:14:03+00:00

Could someone help me with the following two questions? How can I filter on

  • 0

Could someone help me with the following two questions?

  1. How can I filter on Websiteid in the query below?
  2. Is it possible to get data out of two collections in one file? The last value “company” should come from the customer address model which is now commented out.
<?php function getcustomers() 
{
  /* Magento's Mage.php path
   * Mage Enabler users may skip these lines
   */
  require_once ("app/Mage.php");
  umask(0);
  Mage::app("nl");
  /* Magento's Mage.php path */

  /* Get customer model, run a query */
  $collection = Mage::getModel('customer/customer')
  //$collection = Mage::getModel('customer/address')
    ->getCollection()
    ->addAttributeToSelect('*');

  $result = array();
  foreach ($collection as $customer) { $result[] = $customer->toArray();  }

  return $result; 
} 
?>
<html>
<head>
  <title>Customers</title>
  <style>    table {border-collapse: collapse;} 
  td {padding: 5px;   border:1px              solid             #000000;}
  </style>
</head>
<body>
<table>
<tr>
<td>ID</td>
<td>Lastname</td>
<td>Firstname</td>
<td>Email</td>
<td>Is Active?</td>
<td>Date Created</td>
<td>Date Updated</td>
<td>Website ID</td>
<td>Store ID</td>
<td>Zip Code</td>
</tr>
<?php
   $result = getcustomers();
   if(count($result) > 0)
   {
     foreach($result as $key => $value)
     {
       echo "<tr>";
       echo "<td>".$value['entity_id']."</td>";
       echo "<td>".$value['lastname']."</td>";
       echo "<td>".$value['firstname']."</td>";
       echo "<td>".$value['email']."</td>";
       echo "<td>";
       echo $value['is_active'] == 1 ? "Yes" : "No";
       echo "</td>";
       echo "<td>".$value['created_at']."</td>";
       echo "<td>".$value['updated_at']."</td>";
       echo "<td>".$value['website_id']."</td>";
       echo "<td>".$value['store_id']."</td>";
       echo "<td>".$value['zipcode']."</td>";
       echo "</tr>";
     }
   }
   else
   {
     echo "<tr><td colspan=\"7\">No records found</td></tr>";
   }
   ?>
   </table>
   </body>
   </html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:14:04+00:00Added an answer on June 2, 2026 at 6:14 am

    Here, maybe try this? Again I’m not sure if this will work, but I think its in the right direction.

    <?php 
    
    $collection1 = Mage::getModel('customer/customer')->getCollection();
    $collection2 = Mage::getModel('customer/address')->getCollection();
    
    $merged_ids = array_merge($collection1->getAllIds(), $collection2->getAllIds());
    
    $merged_collection = Mage::getResourceModel('customer/customer_collection')
        ->addFieldToFilter('customer_id', $merged_ids)
        ->addAttributeToSelect('*')
        ->addStoreFilter();
    
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone help me with building the following query. I have a table called
Could someone please help me with the following problem: There are two classes MainForm
Could someone help me resolve the discrepancies between the following two cases. In both
Could someone help me figure out what's wrong with the following T-SQL syntax? SELECT
I was hoping someone can help me with the following questions, answers would be
Could someone help me clarify the following conecpts, and the relationship among them ?
Could someone help me out? it's probably something simple i'm overlooking: <script src=http://jqueryui.com/ui/jquery.ui.core.js></script> <script
Could someone help me create some javascript to perform the following behavior. Upon the
hoping someone can help me out with this. I'm trying to figure out whether
I was wondering if someone could help me in generating a linq query for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.