Related Products display

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 năm cách đây
Hello!

I am using version 3.5 and would like to have my Related Products display in a Grid not a Row, and set the number of columns in the rows.

How can I do this?

I tried the RelatedProducts.cshtml

@model IList<ProductOverviewModel>

@using Nop.Web.Models.Catalog;
@if (Model.Count > 0)
{
      <div class="related-products-grid product-grid">
        <div class="title">
            <strong>@T("Products.RelatedProducts")</strong>
        </div>

          <div class="grid">
        
                  @foreach (var item in Model)
                        {
                  <div class="item col-md-12">
                      @Html.Partial("_PartsListBox", item)
                  </div>
                        }
              
          </div>

    </div>
}

But that didn't do it.

Thanks for any advice!

Dave
6 năm cách đây
@model IList<ProductOverviewModel>

@using Nop.Web.Models.Catalog;
@if (Model.Count > 0)
{
    <div class="related-products-grid product-grid">
        <div class="title">
            <strong>@T("Products.RelatedProducts")</strong>
        </div>
        @foreach (var item in Model)
        {
            <div class="item-box">@Html.Partial("_ProductBox", item)</div>
        }
    </div>
}

..and then just copy the .home-page .product-grid styles in your styles.css file and name the new reference as:   .related-products-grid .product-grid
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.