Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

addFilterByRequiredOptions ?? 
 
d.giuralarocca
Jr. Member
 
Total Posts:  8
Joined:  2008-09-03
 

Hi,
currently im working on putting a bundle product inside a grouped product.
I cannot understand what this is for
addFilterByRequiredOptions cause its causing me some problems.

addFilterByRequiredOptions execute this:
$this->addAttributeToFilter(’required_options’, array(array(’neq’=>’1’), array(’null’=>true)), ‘left’);

but i cannot focus on what it means

someone can help?

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
d.giuralarocca
Jr. Member
 
Total Posts:  8
Joined:  2008-09-03
 

ok this is to filter bundle product that have some bundle items with “ Is Required” set to “yes”.
But why this?!?!

 
Magento Community Magento Community
Magento Community
Magento Community
 
joyously
Guru
 
Total Posts:  447
Joined:  2008-08-21
 

It’s part of the database query. It means that they are doing a left join to find products with the required_options field not equal 1. (The second part about null equal true has to do with the join for those records that don’t match anything.)

Since you haven’t said where this code is, I can’t describe more fully why it is doing it this way.
I know you can’t put a configurable into a configurable, but you might want to read some documentation to see if you can put a bundle into a grouped. It almost looks like this code is enforcing the opposite of what you want to do.

 
Magento Community Magento Community
Magento Community
Magento Community
 
d.giuralarocca
Jr. Member
 
Total Posts:  8
Joined:  2008-09-03
 

thanks for the reply.
I need to put bundle product inside grouped product. This was easy i have just modified catalog/etc/config.xml

<catalog>
            <
product>
                <
type>
                  ....
                    <
grouped translate="label" module="catalog">
                        <
label>Grouped Product</label>
                        <
model>catalog/product_type_grouped</model>
                        <
allow_product_types>
                            <
bundle/>
                            <
simple/>
                            <
virtual/>
                        </
allow_product_types>
                    </
grouped>
              ....

in <allow_product_types> i added <bundle/>
Now i don’t know how to put this in local instead of modifying the core.
After doing this the method to show the associated products of a grouped is getAssociatedProducts();
This method calls addFilterByRequiredOptions() so if my bundle has the option “isrequired” set to “yes” it isn’t shown.

 
Magento Community Magento Community
Magento Community
Magento Community
 
d.giuralarocca
Jr. Member
 
Total Posts:  8
Joined:  2008-09-03
 
Seth7ts - 03 November 2008 11:43 PM

This method calls addFilterByRequiredOptions() so if my bundle has the option “isrequired” set to “yes” it isn’t shown.

Nobody can help??why addFilterByRequiredOptions is called in getAssociatedProducts()??

 
Magento Community Magento Community
Magento Community
Magento Community
 
d.giuralarocca
Jr. Member
 
Total Posts:  8
Joined:  2008-09-03
 

nobody????

 
Magento Community Magento Community
Magento Community
Magento Community
 
simonpipeline
Jr. Member
 
Total Posts:  9
Joined:  2012-12-21
 

Hey did you find out what “addFilterByRequiredOptions()” for Mage_Bundle_Model_Product_Type does?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top