Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Read through the official <a href="http://docs.magentocommerce.com/Mage_Eav/Mage_Eav_Model_Entity_Collection_Abstract.html#joinTable" rel="nofollow noreferrer">API documentation</a> and review the <code>joinTable</code>, <code>joinField</code> and <code>joinAttribute</code> methods. </p> <p>Here is an example for joining tables related to the Orders collection: </p> <pre><code>$this-&gt;_orders = Mage::getResourceModel('sales/order_collection') -&gt;addAttributeToSelect('*') -&gt;joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left') -&gt;joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left') -&gt;joinAttribute('billing_street', 'order_address/street', 'billing_address_id', null, 'left') -&gt;joinAttribute('billing_company', 'order_address/company', 'billing_address_id', null, 'left') -&gt;joinAttribute('billing_city', 'order_address/city', 'billing_address_id', null, 'left') -&gt;joinAttribute('billing_region', 'order_address/region', 'billing_address_id', null, 'left') -&gt;joinAttribute('billing_country', 'order_address/country_id', 'billing_address_id', null, 'left') -&gt;joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left') -&gt;joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left') -&gt;joinAttribute('shipping_street', 'order_address/street', 'shipping_address_id', null, 'left') -&gt;joinAttribute('shipping_company', 'order_address/company', 'shipping_address_id', null, 'left') -&gt;joinAttribute('shipping_telephone', 'order_address/telephone', 'shipping_address_id', null, 'left') -&gt;joinAttribute('shipping_fax', 'order_address/fax', 'shipping_address_id', null, 'left'); </code></pre> <p>You should also review <a href="https://stackoverflow.com/q/3949470/336905">this question</a> for examples of what has been tried and their effects. </p> <p>HTH,<br> JD</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload