2014-02-11 169 views
8

我需要下拉将相互连接,例如卡车品牌,卡车型号,型号年份。Magento基于Ajax的属性过滤器

因此,品牌会有一个下降。其中包含卡车品牌的所有属性选项。一旦选定品牌,将出现另一个下拉菜单,其中包含卡车模型的属性选项,但针对该特定品牌进行过滤。一旦选择了模型,年份下拉将包含该品牌和型号的过滤年限。我是新来的Magento,我可以使用

$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(); 

打通PHP的属性和它的选择,但我不明白fitlered第一属性过滤属性选项。并特别使用ajax。

+1

你需要 “相关的属性Magento的” ??或者在选择一个选项后应该出现下一个选项。 – Pankaj

+0

井属性不依赖。但我需要过滤的属性。例如一个属性有10个选项,下一个属性有10个选项。但是,在选择第一个属性后,由于基于第一个属性的适配产品,第二个属性限制为10。 – Asif

+0

从依赖属性..我的意思是在过滤器中的第二个属性的值将取决于在第一个属性上选择什么.. – Pankaj

回答

0

您好,您可以根据您的要求使用下面的代码。

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

或也尝试

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