Developer forum

Forum » Ecommerce - Standard features » TagExists always returns false

TagExists always returns false

Lars Larsen
Reply
Hi,
I am using v. 19.2.3.2 and have made a producttemplateextender. In that I have this simple code:

    public class MyProductTemplateExtender : ProductTemplateExtender
    {
        public override void ExtendTemplate(Dynamicweb.Templatev2.Template template)
        {
            if (template.TagExists("Ecom:Product.Price"))
            {
                var i = 0;
            }
        }
    }

The method template.TagExists() returns false no matter what tag I request! What can be wrong? I have tried to use the method in other templateextenders in the same solution, but the behavior is the same: TagExists always returns false!

Replies

 
Lars Larsen
Reply
This post has been marked as an answer

Figured it out my self..... I was testing TagExists() in wrong context!
Votes for this answer: 0

 

You must be logged in to post in the forum