Skip to content

Products per category #307

@trouble2

Description

@trouble2

I am wondering if it is possible to create a category menu with the number of products in it.
I asked my friend chat GPT but that did not really end well :-)
It suggested something like this:
@inherits NBrightBuy.render.NBrightBuyRazorTokens<NBrightDNN.NBrightRazor>
@using System.Linq
@using Nevoweb.DNN.NBrightBuy.Components

@{
var grpcat = (GroupCategoryData)Model.List.First();
var depth = grpcat.depth;
//this does not work
var count = grpcat.productcount;
}

@if (grpcat.url.StartsWith("javascript"))
{

@grpcat.categoryname (@count)

}
else
{

@grpcat.categoryname (@count)

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions