logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
david9688526  
#1 Posted : Wednesday, May 18, 2022 11:11:08 AM(UTC)
david9688526

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).

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

nadeem  
#2 Posted : Thursday, May 19, 2022 6:26:53 AM(UTC)
nadeem

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?
david9688526  
#3 Posted : Thursday, May 19, 2022 9:14:22 AM(UTC)
david9688526

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.
Users browsing this topic
Guest (2)
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.