First, I've searched Google, SO, and magento SE to no avail. I've seen many results, but none that seemed to work.
I've got a "custom" product listing on the front-end, which uses the below code:
$magentoProduct = Mage::getModel('catalog/product'); $_helper = $this->helper('catalog/output'); $collection = $magentoProduct->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('status', 1) ->setStoreId(Mage_Core_Model_App::ADMIN_STORE_ID); // This doesn't have any effect // ->setOrder('position', 'ASC'); $collectionIds = $collection->getAllIds(); foreach ($collectionIds as $prodId): $magentoProduct->reset(); $magentoProduct = $magentoProduct->load($prodId); $cats = $magentoProduct->getCategoryIds(); // ... do stuff ... endforeach;
I want the sort order to respond to the Product Position (as set in the "Catalog"=>"Manage Categories" interface).
I've tried a variety of things, to no avail.
Any insights? (I'm also open to a better / different approach to this, so feel free to suggest best practices).