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 : Wednesday, August 4, 2021 8:12:58 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Authorized User
Joined: 11/7/2018(UTC)
Posts: 289

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
The Narrow By Brand header shouldn't show if the site has no manufacturers. I haven't tested this, but if there are search results, the list of manufacturers should show only ones relevant to search results. (Maybe it already does)

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

shaharyar  
#2 Posted : Wednesday, August 4, 2021 8:29:10 AM(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 are right. I have registered a bug report.
Thanks
shaharyar  
#3 Posted : Wednesday, August 4, 2021 8:37:17 AM(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)
To fix.

1- Please open file \Website\Views\Category\_ProductFinder.cshtml
2- Replace the whole content with the following.

Code:
@model ProductFinderModel
<aside class="sidebar">
    <div class="widget widget-post-categories">
        <h3><a role="button" data-toggle="collapse" href="#widget-product-finder-collapse" aria-expanded="true" aria-controls="widget-product-finder-collapse">@ViewBag.Caption</a></h3>
        <div class="collapse in" id="widget-product-finder-collapse" aria-expanded="true" role="tabpanel">
            <div class="widget-body">
                @if (Model.ShowExpanOptions)
                {
                    <h4>@GetResourceString("retail.productfinder.expand_your_result")</h4>
                    <ul class="list-unstyled">
                        @foreach (var node in Model.PathNodes)
                        {
                            <li>
                                <a href="@Url.RouteUrl("AbleRoute", Url.AddUpdateQueryStringParameter("CategoryId", node.CategoryId))">@string.Format("{0} (X)", node.Name)</a>
                            </li>
                        }
                        @if (Model.SelectedManufacturer != null)
                        {
                            <li>
                                <a href="@Url.RouteUrl("AbleRoute", Url.RemoveQueryStringParameter("ManufacturerId"))">@string.Format("{0} (X)", Model.SelectedManufacturer.Name)</a>
                            </li>
                        }
                        @if (!string.IsNullOrEmpty(Model.Keywords))
                        {
                            <li>
                                <ins><a href="@Url.RouteUrl("AbleRoute", Url.RemoveQueryStringParameter("Keywords"))">@GetResourceString("retail.productfinder.remove_keyword") @Model.Keywords</a></ins>
                            </li>
                        }
                        @if (Model.ShopByChoices.Count > 0)
                        {
                            foreach (var choice in Model.ShopByChoices)
                            {
                                <li>
                                    <a href="@Url.RouteUrl("AbleRoute", Url.AddUpdateQueryStringParameter("ShopBy", String.Join(",", Model.ShopByChoices.Where(c => c.Id != choice.Id).Select(c=> c.Id.ToString()).ToArray())))">
                                        @choice.FieldName : @choice.Text (X)
                                    </a>
                                </li>
                            }
                        }
                    </ul>
                }
                <div>
                    @if (Model.Categories.Count > 0)
                    {
                        <ul class="list-unstyled">
                            @foreach (var category in Model.Categories)
                            {
                                <li>
                                    <a href="@Url.RouteUrl("AbleRoute", Url.AddUpdateQueryStringParameter("CategoryId", category.CategoryId))">
                                        <span>@category.Name</span>
                                        @if (Model.ShowProductCount)
                                        {
                                            <span class="badge">@category.ProductCount</span>
                                        }
                                    </a>
                                </li>
                            }
                        </ul>
                    }
                </div>
                @if (Model.Manufacturers.Count > 0 && Model.SelectedManufacturer == null)
                {
                    <h4 class="m-l">@GetResourceString("retail.productfinder.narrow_by_brand")</h4>
                    <div>
                        <ul class="list-unstyled">
                            @foreach (var manufacturer in Model.Manufacturers)
                            {
                                <li>
                                    <a href="@Url.RouteUrl("AbleRoute", Url.AddUpdateQueryStringParameter("ManufacturerId", manufacturer.Id))">
                                        <span>@manufacturer.Name</span>
                                        @if (Model.ShowProductCount)
                                        {
                                            <span class="badge">@manufacturer.ProductCount</span>
                                        }
                                    </a>
                                </li>
                            }
                            @if (!Model.AllManufacturers)
                            {
                                <li><a href="@Url.RouteUrl("AbleRoute", Url.AddUpdateQueryStringParameter("AllManufacturers", true))">@GetResourceString("retail.productfinder.see_all_&raquo;")</a></li>
                            }
                        </ul>
                    </div>
                }
                <div>
                    @if (Model.ShopByFields.Count > 0)
                    {
                        foreach (var field in Model.ShopByFields)
                        {
                            <h4 class="m-l">@field.Name</h4>
                            <ul class="list-unstyled">
                                @foreach (var choice in field.Choices)
                                {
                                    IList<string> choiceIds = Model.ShopByChoices.Select(c => c.Id.ToString()).ToList();
                                    choiceIds.Add(choice.Id.ToString());
                                    <li>
                                        <a href="@Url.RouteUrl("AbleRoute", Url.AddUpdateQueryStringParameter("ShopBy", String.Join(",", choiceIds.ToArray())))">
                                            <span>@choice.Text</span>
                                            @if (Model.ShowProductCount)
                                            {
                                                <span class="badge">@choice.ProductCount</span>
                                            }
                                        </a>
                                    </li>
                                }
                            </ul>
                        }
                    }
                </div>
                @if (string.IsNullOrEmpty(Model.Keywords))
                {
                    <h4 class="m-l">@GetResourceString("retail.productfinder.narrow_by_keyword")</h4>
                    <div>
                        <ul class="list-unstyled">
                            @using (Html.BeginRouteForm("AbleRoute", FormMethod.Get))
                            {
                                var parameters = Url.GetQueryStringParameters();
                                foreach (var parameter in parameters)
                                {
                                    @Html.Hidden(parameter.Key, parameter.Value);
                                }

                                <li>
                                    <div class="input-group">
                                        @Html.TextBoxFor(m => m.Keywords, new { @class = "form-control", @placeholder = GetResourceString("retail.productfinder.search_placeholder", false).ToString() })
                                        <span class="input-group-btn">
                                            <button class="btn btn-primary" type="submit"><i class="fa fa-search"></i></button>
                                        </span>
                                    </div>
                                </li>
                                @Html.ValidationMessageFor(m => m.Keywords)
                            }
                        </ul>
                    </div>
                }
            </div>
        </div>
    </div>
</aside>
thanks 1 user thanked shaharyar for this useful post.
judy at Web2Market on 8/5/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.