File tree Expand file tree Collapse file tree 4 files changed +13
-0
lines changed
Catalog/Block/Product/List Expand file tree Collapse file tree 4 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ protected function _prepareData()
4343
4444 Mage::getSingleton ('catalog/product_visibility ' )->addVisibleInCatalogFilterToCollection ($ this ->_itemCollection );
4545
46+ if (!Mage::helper ('cataloginventory ' )->isShowOutOfStock ()) {
47+ Mage::getSingleton ('cataloginventory/stock ' )->addInStockFilterToCollection ($ this ->_itemCollection );
48+ }
49+
4650 $ this ->_itemCollection ->load ();
4751
4852 foreach ($ this ->_itemCollection as $ product ) {
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ protected function _prepareData()
4444 }
4545 Mage::getSingleton ('catalog/product_visibility ' )->addVisibleInCatalogFilterToCollection ($ this ->_itemCollection );
4646
47+ if (!Mage::helper ('cataloginventory ' )->isShowOutOfStock ()) {
48+ Mage::getSingleton ('cataloginventory/stock ' )->addInStockFilterToCollection ($ this ->_itemCollection );
49+ }
50+
4751 $ this ->_itemCollection ->load ();
4852
4953 foreach ($ this ->_itemCollection as $ product ) {
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ protected function _prepareData()
4848 }
4949 Mage::getSingleton ('catalog/product_visibility ' )->addVisibleInCatalogFilterToCollection ($ this ->_itemCollection );
5050
51+ if (!Mage::helper ('cataloginventory ' )->isShowOutOfStock ()) {
52+ Mage::getSingleton ('cataloginventory/stock ' )->addInStockFilterToCollection ($ this ->_itemCollection );
53+ }
54+
5155 if ($ this ->getItemLimit ('upsell ' ) > 0 ) {
5256 $ this ->_itemCollection ->setPageSize ($ this ->getItemLimit ('upsell ' ));
5357 }
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ protected function _getCollection()
155155 $ this ->_addProductAttributesAndPrices ($ collection );
156156
157157 Mage::getSingleton ('catalog/product_visibility ' )->addVisibleInCatalogFilterToCollection ($ collection );
158+ // Always filter out-of-stock regardless of setting, since cart crosssell items are meant for immediate purchase
158159 Mage::getSingleton ('cataloginventory/stock ' )->addInStockFilterToCollection ($ collection );
159160
160161 return $ collection ;
You can’t perform that action at this time.
0 commit comments