jquery - 基于 Magento Ajax 的属性过滤器

标签 jquery ajax magento zend-framework mage

我需要放置相互连接的下拉菜单,例如卡车品牌、卡车型号、型号年份。

因此,品牌将会有一个下拉列表。其中包含卡车品牌的所有属性选项。选择品牌后,将出现另一个下拉列表,其中包含卡车型号的属性选项,但针对该特定品牌进行了筛选。选择型号后,将出现年份下拉列表,其中包含该品牌和型号的筛选年份。我是 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();

但是我没有在第一个属性上过滤属性选项。并特别使用ajax。

最佳答案

嗨,伙计,您可以根据您的要求使用以下代码。

$tableName = Mage::getSingleton('core/resource')->getTableName('bharat_sliders/categories'); $slides->getSelect() ->join(数组(‘sc’=>$tableName), ‘main_table.slider_id = sc.slider_id’, array(‘sc.*’)) ->where(‘sc.category_id = ?’, $this->getCategoryId()); 返回$幻灯片;

或者也尝试

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

关于jquery - 基于 Magento Ajax 的属性过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21694129/

相关文章:

php - 接收文件)通过服务器端 PHP 中的 AJAX

javascript - onclick 函数在 jquery 中不起作用

jquery - 在无表 CSS 布局中实现 jqGrid

jQuery - 单击链接时将光标置于输入字段中

ajax - ActionLink 提交模型值

php - 如何使用 jquery/ajax 编辑表列数据并保存到 mysql

php - 表单提交问题

php - 在magento中覆盖1column.phtml文件

php - 函数 callDoDirectPayment() 的 Magento 支付失败

php - 无法从新删除的产品 Magento 中删除未使用的图像