When building a product collection, is there a way to only include products with a category sort position greater/less/is than (x)?
I've tried searching but couldn't find a case of where anyone had asked this before.
$collection = Mage::getModel('catalog/product')->getCollection()
->addCategoryFilter($category)
->addAttributeToFilter('visibility', array('neq' => 1))
->addAttributeToSort('price', 'asc')
->load();
In the above product collection, we only want to include products if their sort position in the category is 0. We are forcing a large amount of products to appear at the end of the category by setting their position to 1000.
I suppose I could create a custom attribute with something like a Yes/No value and set all the products to Yes that we want to include in this product collection including it with a addAttributeToFilter
but was hoping for a less fiddly/time-consuming way if possible.