Magento – How to display core Country of Manufacture attribute in layered navigation

attributesdropdown-attributelayered-navigationmanufacturer

I like to have core Country of Manufacture attribute displayed in the layered navigation but it seems simply selecting one of the "Filterable" options in Use In Layered Navigation field is not outputting anything. Is that possible with this core attribute or best to just create a new attribute and manage the country of manufacture data from there?

Best Answer

It currently can't be done without rewriting Magento code.

That attribute on the backend has a specific model it uses

Databse

The model is located here: Mage_Catalog_Model_Product_Attribute_Source_Countryofmanufacture

Model

Looking at the logic in the model, it doesn't even call or mention what products are in that specific category. Going further into the Abstract, the Abstract contains no logic for layered navigation.

You can change it to be "filterable (with no results)" but that will only list the all the countries available.

I'm going to tinker with the logic to see if I can get it working, but it wouldnt be a quick fix.

[EDIT]:
Here is a link to a pull request from the Magento bugathon that implemented the required changes in the country of manufacturer and also the boolean source model.
Unfortunately it didn't get merged into the core because the original issue was related to a different source model (the table type).
The fix however will resolve your issues. https://github.com/magento/bugathon_march_2013/pull/256

Here is the link to a patch containing only source model changes (not the tests): https://gist.github.com/Vinai/bb1928021811f247c331

Related Topic