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
judy at Web2Market  
#1 Posted : Thursday, August 26, 2021 6:26:29 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
We are starting to use ShopBy on a site and I noticed that if you use a dropdown select box in the admin, there doesn't seem to be a way to not select a value. If you don't select one, the first value is saved by default. Is this correct? Is there a way around this?
Thanks

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

shaharyar  
#2 Posted : Thursday, August 26, 2021 12:21:02 PM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
You can try the following fix.

1- Open file \Website\Areas\Admin\Views\Product\EditProductTemplates.cshtml
2- Search for
Code:
@Html.DropDownListFor(m => Model.ProductTemplates[a].ProductTemplatesFields[i].DropDownSelectedChoice, Model.ProductTemplates[a].ProductTemplatesFields[i].InputChoicesSelectList, new { @class = "form-control" })

3- Replace with
Code:
@Html.DropDownListFor(m => Model.ProductTemplates[a].ProductTemplatesFields[i].DropDownSelectedChoice, Model.ProductTemplates[a].ProductTemplatesFields[i].InputChoicesSelectList, string.Empty, new { @class = "form-control" })


4- Open file \Website\Areas\Admin\Controllers\ProductController.cs
5- Search for
Code:

case CommerceBuilder.Products.InputType.DropDownListBox:
case CommerceBuilder.Products.InputType.ListBox:
   return inputModel.DropDownSelectedChoice

6- Replace with
Code:

case CommerceBuilder.Products.InputType.DropDownListBox:
case CommerceBuilder.Products.InputType.ListBox:
    return inputModel.DropDownSelectedChoice != null ? inputModel.DropDownSelectedChoice : string.Empty;



I have shared a quick fix for you to go on. Please try and test these changes locally before applying on a live site.
thanks 1 user thanked shaharyar for this useful post.
judy at Web2Market on 8/31/2021(UTC)
Users browsing this topic
Guest
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.