I've an issue with using an if compare with a custom build tag.

For example this is my tag:

class basketTags extends Tags
{
  public function basketcount(){
    $basketCount = 2;
    return $basketCount;
  }
}


When I use the tag with a compare in my template, the compare does not work:

//this will still put hidden even when the count is not 0
<div class="order-counter {{if basket:basketcount == 0 }}hidden{{/if}}">{{basket:basketcount}}</div>


Am I doing something wrong here? Any way to get around this?

Answered by Erin Dalzell! Go to answer.