I'm currently working with Magento CE 1.X, specifically in constructing a product view wrapping the simple products within their configurable product for a grouped display.
The issue I was having was that the layered navigation attributes were only applying to the Configurable product, not the simple products that are lumped within. I've set up a filter to accept the selected filter ID, but I can't figure out how to retrieve the ID itself.
The current loop i'm working with is this...
$appliedFilters = Mage::getSingleton('catalog/layer')->getState()->getFilters();
foreach ($appliedFilters as $item) {
$item->getName(); // Retrieves Name
$item->getLabel(); // Retrieves selected value name
$item->getFilter()->getRequestVar(); // Retrieves filter code I.E. color
}
I haven't been able to sniff out the method for retrieving the option id which is used to filter the collection, any help would be appreciated.
答案 0 :(得分:1)
After snooping through the thousands of lines spit out by var_dumping $item, I found it can be accessed with...
$item->getValue();
答案 1 :(得分:0)
您可以使用以下代码获取选项项目的attribute_id
或$item->getFilter()->getAttributeModel()->getAttributeCode();
$item->getFilter()->getAttributeModel()->getAttributeId();
:
CELERYD_PREFETCH_MULTIPLIER = 1
CELERYD_MAX_TASKS_PER_CHILD = 1