We use settag, tag.count() and LoopExists("LoopName") in the template extenders, so we can use specific part of the code for a template. This work good when we use a html template, but with a Razor template we don't anything. The razor template doesn't have anything when we use the SetTag functionality and the Tag.Count() = 0. Is there a work around for this?
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Dynamicweb.eCommerce.Frontend;
using Dynamicweb.eCommerce.Orders;
using System.Web;
namespace CustomOrderTemplateExtender
{
public class CustomOrderTemplateExtender : OrderTemplateExtender
{
public override void ExtendTemplate(Dynamicweb.Rendering.Template template)
{
if (this.RenderingState == TemplateExtenderRenderingState.Before)
{
Order order = this.Order;
try
{
if (template.Tags.Count() > 0)
{
if (template.LoopExists("CustomLoop")) {
//The rest of the code
}
}
template.SetTag("CustomPrice", "0.00");
}
}
}
}
}