1

I’d like to list products using Product Collections that list ALL products regardless is_salable or in_stock are false. Is there a way I can disable all is_salable or in_stock checks for Mage::getResourceModel('catalog/product_collection') ?

Getting the product collection is done using:

$selections = Mage::getResourceModel('catalog/product_collection')
  ->addAttributeToSelect('*')
  ->addMinimalPrice()
  ->addFinalPrice()
  ->addTaxPercents()
  ->addStoreFilter()
  ->addIdFilter($selection_ids, false)
  ->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);

  $selections->load();

but because "Show products that are out of stock" ist set to NO it automatically wipes all products that are not in stock.

Is there a way to bypass the "show_out_of_stock" check? Thanks for any assistance!

2

Very weird. Can't really tell why, but removing ->addFinalPrice() fixed the issue. Obviously addFinalPrice() removes all products that aren't saleable/in stock.

2

With Magento 1.8, comment addMinimalPrice and addFinalPrice in *Mage_Catalog_Model_Layer::prepareProductCollection()* to show out of stock products with Show products that are out of stock set to NO.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.