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

PHP help needed: Create filter for isSaleable status
 
turbo1
Sr. Member
 
Avatar
Total Posts:  296
Joined:  2008-08-19
Los Angeles, CA
 

I’m hoping someone who knows PHP better than I do , can help. I’m trying to modify a script I have to filter output only to items that are saleable (ie, items not marked out of stock).

I know that I need to somehow call the function “isSaleable”, and add a filter. But I don’t know how! Can anyone point me in the right direction?

 
Magento Community Magento Community
Magento Community
Magento Community
 
retif
Sr. Member
 
Total Posts:  171
Joined:  2008-08-16
Odessa, Ukraine
 

$collection->addAttributeToFilter('status'1);
 
Magento Community Magento Community
Magento Community
Magento Community
 
turbo1
Sr. Member
 
Avatar
Total Posts:  296
Joined:  2008-08-19
Los Angeles, CA
 

Thank you for your reply!  Doesn’t this just filter a product that’s disabled?  I need a filter for enabled products that are out of stock.  I will try your suggestion though!

 
Magento Community Magento Community
Magento Community
Magento Community
 
turbo1
Sr. Member
 
Avatar
Total Posts:  296
Joined:  2008-08-19
Los Angeles, CA
 

No luck :( I appreciate the suggestion though.

Fatal error: Call to a member function addAttributeToFilter() on a non-object

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gregersen
Member
 
Total Posts:  57
Joined:  2008-06-15
 

Has anyone found a solution to this one?
I’m very interested too…

 
Magento Community Magento Community
Magento Community
Magento Community
 
kaamiljj
Sr. Member
 
Avatar
Total Posts:  125
Joined:  2009-03-15
Kapaa
 

In my case I’m adding another inventory stock status “Available only as a collection” that is visible if the product inventory stock count = 666. When that happens “Add to cart” button should not be visible and product selable statue should be false.

Tell me please where is the main file that defies isselable function?

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