I don’t like the way Magento handles the Shop By Category drill down (specifically how it just adds the subcategory id as a variable on the end instead of going to the actual permalink of the subcategory) so I’ve hacked together a category listing that works how I’d like but I’m having trouble pulling the Shop By Price filter out of catalog/layer/view and putting it in to catalog/navigation/left.
So, the ultimate question is how can I add the Shop By Price filter to the catalog/navigation/left template?
to catalog.xml’s default/left block, but get this error:
Fatal error: Call to a member function getProductCollection() on a non-object in /home/hidden.com/htdocs/app/code/core/Mage/Catalog/Model/Layer.php on line 47
so I was wondering if you have found a solution to your problem in the meantime and might point me into the right direction.
I’ve been dealing with the same error with New products off the homepage, I think it’s got something to do with trying to figure out which category something’s in. The products render fine when you look at them within a category, but when you try to follow a URL that doesn’t contain the category, you get an error. Here’s why.
/** * Retrieve current layer product collection * * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */ public function getProductCollection() { $collection = $this->getData('product_collection'); if (is_null($collection)) { $collection = $this->getCurrentCategory()->getProductCollection(); $this->prepareProductCollection($collection); $this->setData('product_collection', $collection); }
return $collection; }
Line 47 --> $collection = $this->getCurrentCategory() is not returning a valid object. As far as how to solve it (for new products) I am still working on a solution that doesn’t require me to revamp anything on the back-end. But I believe that’s the source of the issue.
I don’t like the way Magento handles the Shop By Category drill down (specifically how it just adds the subcategory id as a variable on the end instead of going to the actual permalink of the subcategory) so I’ve hacked together a category listing that works how I’d like but I’m having trouble pulling the Shop By Price filter out of catalog/layer/view and putting it in to catalog/navigation/left.
So, the ultimate question is how can I add the Shop By Price filter to the catalog/navigation/left template?
So, how did you end up doing “Shop by Price” as I see on your toy website? Is there a way to do this without doing programming in core code (making upgrades harder)?