Skip to main content
deleted 3 characters in body
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

I want to filter collection for same attribute having two either values.

example:

->addFieldToFilter('customer_group_id',Mage::getSingleton('customer/session')->getCustomer()->getGroupId())   


->addFieldToFilter('sales_org',Mage::getSingleton('customer/session')->getCustomer()->getSalesOrgId())
              

->addFieldToFilter('sales_office',Mage::getSingleton('customer/session')->getCustomer()->getSalesOfficeId())

My question is.My question is.

If cutomer_group_id == 12cutomer_group_id == 12 then it should have sales_org and sales_office valuesales_org and sales_office value. else if customer_group_id == 13customer_group_id == 13 then it should be null in sales_org and sales_officeshould be null in sales_org and sales_office.

How can i achieve this filter.

Thanks in advancefilters.

I want to filter collection for same attribute having two either values.

example:

->addFieldToFilter('customer_group_id',Mage::getSingleton('customer/session')->getCustomer()->getGroupId())   


->addFieldToFilter('sales_org',Mage::getSingleton('customer/session')->getCustomer()->getSalesOrgId())
              

->addFieldToFilter('sales_office',Mage::getSingleton('customer/session')->getCustomer()->getSalesOfficeId())

My question is. If cutomer_group_id == 12 then it should have sales_org and sales_office value. else if customer_group_id == 13 then it should be null in sales_org and sales_office.

How can i achieve this filter.

Thanks in advance.

I want to filter collection for same attribute having two either values.

example:

->addFieldToFilter('customer_group_id',Mage::getSingleton('customer/session')->getCustomer()->getGroupId())   


->addFieldToFilter('sales_org',Mage::getSingleton('customer/session')->getCustomer()->getSalesOrgId())
              

->addFieldToFilter('sales_office',Mage::getSingleton('customer/session')->getCustomer()->getSalesOfficeId())

My question is.

If cutomer_group_id == 12 then it should have sales_org and sales_office value. else if customer_group_id == 13 then it should be null in sales_org and sales_office.

How can i achieve this filters.

Source Link
Viraj
  • 183
  • 1
  • 7

Filter collection on same attribute with different values

I want to filter collection for same attribute having two either values.

example:

->addFieldToFilter('customer_group_id',Mage::getSingleton('customer/session')->getCustomer()->getGroupId())   


->addFieldToFilter('sales_org',Mage::getSingleton('customer/session')->getCustomer()->getSalesOrgId())
              

->addFieldToFilter('sales_office',Mage::getSingleton('customer/session')->getCustomer()->getSalesOfficeId())

My question is. If cutomer_group_id == 12 then it should have sales_org and sales_office value. else if customer_group_id == 13 then it should be null in sales_org and sales_office.

How can i achieve this filter.

Thanks in advance.