AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
Problem with DropDownList for Kit Components
Rank: Newbie
Groups: Developers
Joined: 4/17/2020(UTC) Posts: 1
Thanks: 1 times
|
Our products have some optional kit components. When we use the Dropdown List, the Default Header is displayed as text in a span above the DDL rather than an option in the list. In _KitComponent.cshtml, we have modified the SelectList code to include the Default Header: Quote: @Html.DropDownList("KIT_COMPONENT_" + Model.Id, new SelectList(Model.KitProducts, "Id", "Name", Model.SelectedKitProductId.ToString()), Model.HeaderOption, new { @class = "form-control", onchange = "$('#HDN_SUBMIT').click();" })
Instead of: Quote: @Html.DropDownList("KIT_COMPONENT_" + Model.Id, new SelectList(Model.KitProducts, "Id", "Name", Model.SelectedKitProductId.ToString()), new { @class = "form-control", onchange = "$('#HDN_SUBMIT').click();" })
But the Default Header text still displays above the DLL. This seems like a major bug that has been around for several versions (we are using currently using version 9.0.5).
|
|
|
|
Rank: Advanced Member
Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System Joined: 10/11/2018(UTC) Posts: 110
Thanks: 19 times Was thanked: 18 time(s) in 18 post(s)
|
I have confirmed the bug and reported it to be fixed in a future release. Thank you! You can apply the following fix: Open Website/Views/Product/_BuyProductDialog.cshtml file, locate the following line of code, and comment or remove it. Code:
<span>@kitComponent.HeaderOption</span>
Now open the Website/Views/Product/_KitComponent.cshtml file and add the default header to the dropdown like this: Code:
@Html.DropDownList("KIT_COMPONENT_" + Model.Id,
new SelectList(Model.KitProducts, "Id", "Name", Model.SelectedKitProductId.ToString()), Model.HeaderOption, new { @class = "form-control", onchange = "$('#HDN_SUBMIT').click();"})
You might be adding this code to the admin _KitComponent file i.e. Website/Areas/Admin/Views/Orders/_KitComponent.cshtml which is not working in your case?
|
|
|
|
Rank: Newbie
Groups: Developers
Joined: 4/17/2020(UTC) Posts: 1
Thanks: 1 times
|
That is the fix I already have in place. Good to have confirmation that the fix I came up with is correct.
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
Problem with DropDownList for Kit Components
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close