V3.8 Move filters to _ColumnsTwo

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Anyone know how to move the product 'filters' on the category page from the categorytemplate to _ColumnsTwo.cshtml (left hand side)?
7 years ago
Hello, I've just completed exactly that for a theme I have been working on so..
At the top of _ColumnsTwo.cshtml
you will need
@model CategoryModel
@using Nop.Core.Domain.Common;
@using Nop.Core.Domain.Seo;
@using Nop.Core.Infrastructure;
@using Nop.Web.Models.Catalog;
and lower down the page..
<div class="side-2">
    @if (IsSectionDefined("left"))
    {
        @RenderSection("left")
    }
    else
    {       if (Model.Products.Count > 0)
        {
            @Html.Partial("_CatalogSelectors", Model.PagingFilteringContext, new ViewDataDictionary())
        }
        <div class="product-filters">
            @*filtering*@
            @if (Model.PagingFilteringContext.PriceRangeFilter.Enabled)
            {
                @Html.Partial("_FilterPriceBox", Model.PagingFilteringContext.PriceRangeFilter, new ViewDataDictionary())
            }
            @*filtering*@
            @if (Model.PagingFilteringContext.SpecificationFilter.Enabled)
            {
                @Html.Partial("_FilterSpecsBox", Model.PagingFilteringContext.SpecificationFilter, new ViewDataDictionary())
            }
        </div>
        @Html.Widget("left_side_column_before")
        @Html.Action("CategoryNavigation", "Catalog", new { currentCategoryId = currentCategoryId, currentProductId = currentProductId })
        @Html.Widget("left_side_column_after_category_navigation")
        @Html.Action("ManufacturerNavigation", "Catalog", new { currentManufacturerId = currentManufacturerId })
        @Html.Action("VendorNavigation", "Catalog")
        @Html.Action("RecentlyViewedProductsBlock", "Product", new { productThumbPictureSize = 64 })
        @Html.Action("PopularProductTags", "Catalog")
        @Html.Action("PollBlock", "Poll", new { systemKeyword = "LeftColumnPoll" })
        @Html.Widget("left_side_column_after")
    }
</div>
7 years ago
Did this work at all? I tried copying and pasting this code but was given an internal error message on my site. What am I missing?
7 years ago
Hello, did you remove this bit

'and lower down the page..'

?

That code should work ok.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.