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
|
|
|
|
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.
|
1 user thanked shaharyar for this useful post.
|
|
|
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