Table of Contents

Class ProductListTemplateExtender

Namespace
Dynamicweb.Ecommerce.Products
Assembly
Dynamicweb.Ecommerce.dll

Product list template extender. Extends the rendering of a ProductCollection.

public abstract class ProductListTemplateExtender : TemplateExtender
Inheritance
ProductListTemplateExtender
Inherited Members

Examples

using Dynamicweb.Ecommerce.Products;

namespace Dynamicweb.Ecommerce.Examples
{
    public class ProductListTemplateExtenderSample : ProductListTemplateExtender
    {
        public override void ExtendTemplate(Dynamicweb.Rendering.Template template)
        {
            // Verify that User is logged in
            if (!Security.UserManagement.User.IsFrontendUserLoggedIn())
                return;

            // Verify that Order is not complete
            if (Order == null || Order.Complete)
                return;

            // Set my custom template tag
            string tagContent;
            tagContent = ProductList.Count > 50 ? "You are showing more than 50 products on this page: {0}" : "You are showing less than 50 products on this page: {0}";
            template.SetTag("MyCustomModule.MyCustomTemplateTag", string.Format(tagContent, ProductList.Count));
        }
    }
}

Properties

Order

Gets or sets the order.

public Order Order { get; set; }

Property Value

Order

The order.

ProductList

Gets or sets the product list.

public ProductCollection ProductList { get; set; }

Property Value

ProductCollection

The product list.

To top