0

问候,

我很不幸需要这个:

    Product has (lets say) 6 attributes with "Yes/No" values.
    I need a dropdown on that product's page that will populate with attributes with "yes" value.

    attributes are :bundle1,bundle2....,bundle6.
    When selection is made - I need to know whats have been selected to pass that to php on that page.

我不知道 Magento 中预先存在什么(就 Ajax 片段而言)可用于此,正在寻找解决方案......

我使用了额外的 request.js 并从 DB 中新创建的表中提取属性(手动,用于 1 个产品,仅用于测试)并且它有效。但是,这不是主意,我不想每次都手动进行。

语法正在杀死我。

谢谢你。

4

1 回答 1

1

这可能一点用都没有……但我最近刚刚创建了一个利用 Magento 的 ajax 自动填充功能的模块。该模块所做的是根据您输入的字符串自动填充所有制造商。我知道这不是您想要做的,但这可能会帮助您入门,至少使用 ajax:

/app/etc/modules/Ash_Manufacturers.xml http://pastie.org/841014

/app/code/local/Ash/Manufacturers/etc/config.xml http://pastie.org/841017

/app/code/local/Ash/Manufacturers/controllers/IndexController.php http://pastie.org/841018

/app/code/local/Ash/Manufacturers/Block/Manufacturers.php http://pastie.org/841020

查看第 79-92 行:/app/design/frontend/default/ash/template/catalog/layer/filter.phtml:http ://pastie.org/841027

于 2010-02-24T19:25:18.197 回答