基于Magento Ajax的属性过滤器

Asi*_*sif 10 ajax jquery zend-framework magento mage

我需要放下相互连接的下拉菜单,例如Truck Brand,Truck Model,Model Years.

所以Brand会有一个下拉列表.其中包含Truck Brands的所有属性选项.选择品牌后,将显示另一个下拉列表,其中包含卡车模型的属性选项,但针对该特定品牌进行过滤.选择模型后,年份下拉列表将包含该品牌和型号的过滤年份.我是Magento的新手,我可以通过php使用获取属性及其选项

  $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();
Run Code Online (Sandbox Code Playgroud)

但是我没有在第一个属性上得到过滤的属性选项.并且特别使用ajax.

Bha*_* M. 1

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

\n\n

$tableName = Mage::getSingleton(\xe2\x80\x98core/resource\xe2\x80\x99)->getTableName(\xe2\x80\x98bharat_sliders/categories\xe2\x80\x99);\n$slides->getSelect ()\n->join( array(\xe2\x80\x98sc\xe2\x80\x99=>$tableName),\n\xe2\x80\x98main_table.slider_id = sc.slider_id\xe2\x80\x99, array (\xe2\x80\x98sc.*\xe2\x80\x99))\n->where(\xe2\x80\x98sc.category_id = ?\xe2\x80\x99, $this->getCategoryId());\ nreturn $slides;

\n\n

或者也尝试

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

\n