Magento Ajax Based Attributes Filters
Asked Answered
M

1

10

I need to place dropdowns which will be connected to each other e.g Truck Brand, Truck Model, Model Years.

So There will be one drop down for Brand. which contains all the attribute options of Truck Brands. Once Selected Brand, another dropdown will appear which contains the attribute options of Truck Model but filtered for that specific brand. Once Model is selected, the years dropdown will apear containing the filtered years for that brand and model. I am new to Magento, and I can get attributes and its options through php using

  $attributeId = Mage::getResourceModel('eav/entity_attribute')
 ->getIdByCode('catalog_product','attribute_code_here');
  $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
  $attributeOptions = $attribute ->getSource()->getAllOptions();

But I dont get filtered Attribute Options fitlered on first attribute. and speaicly using ajax.

Miscalculate answered 11/2, 2014 at 5:48 Comment(4)
do you required "dependent attributes magento"..?? or just next option should appear after selecting one option..??Externalize
well attributes are not dependent. but I need filtered attributes. e.g there are 10 options of one attribute, and 10 for next attribute. But after selecting 1st attribute, the second attrutes limits to 10 due to fitlered products based on first attribute.Miscalculate
from dependent attribute.. I meant value of second attribute in filters will depend on what is selected on first attribute..Externalize
so you have 3 seprate table for brand,model& year respectively. rightDescendent
B
1

Hi buddy you can use below code as per your requirement.

$tableName = Mage::getSingleton(‘core/resource’)->getTableName(‘bharat_sliders/categories’); $slides->getSelect() ->join( array(‘sc’=>$tableName), ‘main_table.slider_id = sc.slider_id’, array(‘sc.*’)) ->where(‘sc.category_id = ?’, $this->getCategoryId()); return $slides;

or also try

http://bmagento.wordpress.com/2014/04/13/join-two-table/
http://bmagento.wordpress.com/2014/04/08/join-two-table-in-magento/

Bever answered 29/4, 2014 at 14:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.