Developer forum

Forum » Ecommerce - Standard features » RE: Get Manufacturers in loop

RE: Get Manufacturers in loop

Michael John
Reply

Hi,

Is there any way, to get a loop of the created manufacturers in a list like:

<ul>

@foreach (var i in GetLoop("Products")) {

var brandItemName = @i.GetString("Ecom:Manufacturer.Name");

<li>@brandItemName</li>

}

</ul>

 

The above code, will list the same manufacturer multiple times...


Replies

 
Vladimir
Reply
This post has been marked as an answer

Hi  Michael,

@{
    var manufactorers = Dynamicweb.eCommerce.Common.Context.Manufacturers;
    <ul>
    @foreach (var m in manufactorers) {
        var brandItemName = @m.Name;
        <li>@brandItemName</li>
    }
    </ul>
}

I hope this snippet will solve the problem:)

Best regads,

Vladimir

Votes for this answer: 1

 

You must be logged in to post in the forum