English 中文(简体)
Magento : create ajax dropdown populated with labels of 3 product s attributes.
原标题:

Greetings,

I m, unluckily in need of having this :

    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.

I have no idea what preexists in Magento (in terms of Ajax snippets) that could be used for this, searching for solution...

I used additional request.js and pulled attributes from a newly created table in DB (manually, for 1 product, just for test) and it works. But, thats not idea, I dont want to do it manually everytime.

Syntax is killling me.

Thank you.

问题回答

This may not be helpful at all... But I just recently created a module that taps into Magento s ajax autopopulate functionality. What this module does is does an autopopulate of all the manufacturers, depending on the string you are typing in. I know this isn t directly what you are wanting to do, but this may help you get started, at least with the 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

Look at rows 79-92 on this one: /app/design/frontend/default/ash/template/catalog/layer/filter.phtml : http://pastie.org/841027





相关问题
PHP Combo Box AJAX Refresh

I have a PHP page that currently has 4 years of team positions in columns on the page. The client wants to select the players in positions and have first, second and thrid choices. Currently the page ...

jquery + ajax + json + fill dropdown list not working

I m pretty sure i am almost there....but i cannot figure out how to iterate through json objects and fill a dropdown list. Here is the js code: My JSON data returned:{"name":"County1","name":"County1"...

Gridviews and DropdownLists

Is it possible to change the data source of a dropdown list in a gridview from another dropdown list selected index changed method in the same gridview? for example I have a dropdown that needs to ...

Adding a new value to the drop down list box

I have a drop down list box which has one of the values to be others. I want to move these value to the last. Please help me with this. The code i am using is as follows ddlAssetsCountryOthersone....

Show hide div using codebehind

I have a DropDownList for which I am trying to show a div OnSelectedIndexChanged but it says OBJECT REQUIRED. I am binding the DataList in that div: aspx: <asp:DropDownList runat="server" ID="...

Why might dropdownlist.SelectedIndex = value fail?

I have a dropdown list that I am binding to a datatable. Here is the code I am using to do it: ddlBuildAddr.DataSource = buildings ddlBuildAddr.DataTextField = "buildingName" ddlBuildAddr....

热门标签