Skip to content

Instantly share code, notes, and snippets.

@jclecas
Last active November 9, 2016 19:21
Show Gist options
  • Save jclecas/841d4d5e718dd2e662f39ed7be227c21 to your computer and use it in GitHub Desktop.
Save jclecas/841d4d5e718dd2e662f39ed7be227c21 to your computer and use it in GitHub Desktop.
Magento Collection // Join on attribute table
<?php
/** @var Mage_Customer_Model_Resource_Customer_Collection $collection */
$collection = Mage::getModel('customer/customer')->getCollection();
$collection = $collection->joinAttribute(
'my_attribute',
'customer/my_attribute',
'entity_id',
null,
'left'
);
$collection = $collection->addAttributeToFilter('my_attribute', array('null' => true));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment