# Lodash / Underscore templates (`type="text/template"`)

Ticketack shortcodes embed Underscore/lodash templates in:

```html
<script type="text/template" id="tkt-…-tpl">
```

WordPress `convert_chars()` (and page builders that re-apply `the_content`
filters, e.g. Elementor) turn bare `&` into `&#038;`. That breaks JS:

```text
<% if (items && items.length) { %>
→ <% if (items &#038;&#038; items.length) { %>
→ _.template() → SyntaxError → cart spinner forever
```

## Rules when editing templates

1. **Never write `&&` (or a bare `&`) inside lodash template markup** that is
   echoed into the page. Prefer nested `if`, or `a ? b : false`.
2. PHP `&&` outside the lodash script (normal PHP in `.tpl.php`) is fine.
3. `LodashTemplatesFilter` repairs encoded ampersands in those scripts as a
   safety net — do not rely on it alone; keep templates clean.

## How to test

Open the cart page, view source, search for `text/template` and confirm
conditions still contain raw `&&` (or the rewritten `? :` form), never
`&#038;&#038;`.
