1

I am having a problem of displaying out of stock products website based.

In admin System -> Configuration -> Inventory, there's a field call Display Out of Stock Products. But it is a global field meaning that we cannot set it in website scope.

I am running 2 sites using the same Magento instance.

My question is: Is there anyway to show out of stock products only for a specific website?

0

this will return you out of stock collection base on current website

$products = Mage::getModel('catalog/product')
                    ->getCollection()->addWebsiteFilter()
                    ->joinField(
                            'is_in_stock',
                            'cataloginventory/stock_item',
                            'is_in_stock',
                            'product_id=entity_id',
                            '{{table}}.stock_id=1',
                            'left'
                    )
                    ->addAttributeToFilter('is_in_stock', array('eq' => 0));

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.