Best sellers table format

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 yıl önce
Hi there

I am using 2.10 - I am looking at the bestersellers and featured products.

I want there outputs from the datalist to be in <ul><li> but its outputting to tables. Does anyone know how to change this?

I had in ccs xhtml forum but think it was the wrong place.

Thank you
12 yıl önce
i had the same issue, looked for answer and could not find.
however I have created classes for the tr and td in the datalist

for example:
I could not vertical-align the home page category items so i added

.home-page-category-grid td
{
   vertical-align:top;
  }

hope it helps
12 yıl önce
Thank you for the reply. Its not the styling that I am looking to do.

I am looking to implement a slider on the bestsellers and featured items. However, with it going into a table rather than <ul> <li> I cannot get it to work.

Does anyone know how to solve this one?

Dave.
12 yıl önce
For 2.00 and 2.10, to display the best sellers in an unordered list, change the Catalog/HomepageBestSellers.cshtml view to the following:
@model IList<ProductModel>

@using Nop.Web.Framework.UI;
@using Nop.Web.Models.Catalog;
@if (Model.Count > 0)
{
    <div class="bestsellers">
        <div class="title">
            @T("Bestsellers")
        </div>
        <div class="clear">
        </div>
        <ul>
            @foreach (var item in Model)
            {
                <li>
                    <div class="item-box">
                        <div class="item">
                            <div class="product-title">
                                <a href="@Url.RouteUrl("Product", new { productId = item.Id, SeName = item.SeName })" title="@item.DefaultPictureModel.Title">
                                    @item.Name</a>
                            </div>
                            <div class="picture">
                                <a href="@Url.RouteUrl("Product", new { productId = item.Id, SeName = item.SeName })" title="@item.DefaultPictureModel.Title">
                                    <img style="border-width: 0px;" alt="@item.DefaultPictureModel.AlternateText" src="@item.DefaultPictureModel.ImageUrl"
                                        title="@item.DefaultPictureModel.Title" /></a>
                            </div>
                        </div>
                    </div>
                </li>
            }
        </ul>
    </div>
}
You can add this as a new file (with the same name) in your theme's folder (in the Views/Catalog folder) to keep the original view.

.
12 yıl önce
Tried putting this into 2.2 and it didnt, is there anything different that needed.

I actually put it the themes/content folder and it errored, put it into the normal file and nothing changed ie still as a table.
12 yıl önce
The HomepageBestSellers view for 2.20 is different from the 2.00/2.10 version.

For 2.20, to display the best sellers in an unordered list, change the Catalog/HomepageBestSellers.cshtml view to the following:
@model HomePageBestsellersModel

@using Nop.Web.Framework.UI;
@using Nop.Web.Models.Catalog;
@if (Model.Products.Count > 0)
{
    <div class="product-grid bestsellers">
        <div class="title">
            @T("Bestsellers")
        </div>
        <div class="clear">
        </div>
        @if (Model.UseSmallProductBox)
        {
            
            <ul>
                @foreach (var item in Model.Products)
                {
                    <li>
                        <div class="item-box">
                            @Html.Partial("_ProductSmallBox", @item)
                        </div>
                    </li>
                }
            </ul>
        }
        else
        {        
            <ul>
                @foreach (var item in Model.Products)
                {
                    <li>
                        <div class="item-box">
                            @Html.Partial("_ProductBox", @item)
                        </div>
                    </li>
                }
            </ul>
        }
    </div>
}

To keep the original HomepageBestSellers view unmodified, add the above as a new file (named HomepageBestSellers.cshtml) in

Themes\YOUR_THEME_NAME\Views\Catalog (you will need to create the Catalog folder).

.
12 yıl önce
Wow, that looks even easier than the first solution :o)

Now I understand a little more. Think I am going to have to a little more into the MVC on the asp.net website.

Thank you for helping.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.