Custom HTML & CSS
Full control over widget appearance.
When to Use
- Templates don't match your brand
- Need specific layout changes
- Want to add icons or images
Access
- Go to Settings → Cart Widget
- Scroll to Advanced Template Editor
- Tick Enable advanced template editing
- Edit the HTML and CSS directly
HTML Variables
{{title}}: fee title{{description}}: fee description{{price}}: formatted amount{{checkboxProperties}}: the checkbox input attributes
{{checkboxProperties}}is the working variable, not{{checkbox}}.{{checkbox}}is left in your HTML as plain text. Put{{checkboxProperties}}on your<input type="checkbox">so it starts in the right state, and give it a recognised class (see below) so the toggle works.
Example HTML
<div class="tackon-widget">
<div class="tackon-header">
<span class="tackon-icon">🎁</span>
<span class="tackon-title">{{title}}</span>
</div>
<p class="tackon-description">{{description}}</p>
<div class="tackon-row">
<span class="tackon-price">{{price}}</span>
<label class="tackon-label">
<input type="checkbox" class="cartcharge-widget-checkbox" {{checkboxProperties}}>
<span>Add to my order</span>
</label>
</div>
</div>
Keep the price outside the label. Put
{{price}}in an element with classtackon-priceorcartcharge-widget-priceso the amount updates when the cart changes. Keep it outside the checkbox's<label>: when Toggle checkbox isDisabled, TackOn hides the label that holds the checkbox, and anything inside it.
The checkbox class is a contract. TackOn wires up the toggle by looking for a recognized class name. Use one of
cartcharge-widget-checkbox,tackon-widget-checkbox,cartwrap-widget-checkbox, orgw-toggleon the<input>. Rename it to something custom and the widget renders but never applies the fee. Style it with your own additional class instead.
Example CSS
.tackon-widget {
border: 1px solid #e5e5e5;
border-radius: 8px;
padding: 16px;
margin: 16px 0;
}
.tackon-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
}
.tackon-title {
font-weight: 600;
}
.tackon-description {
color: #666;
font-size: 14px;
margin-bottom: 12px;
}
.tackon-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.tackon-label {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
}
Tips
- Test on desktop, tablet, mobile
- Use your brand colors
- Keep sufficient contrast
- Always include
{{checkboxProperties}}on a checkbox with a recognized class
Going deeper
For the complete template-variable reference and the advanced editor in context, see Designing the Cart Widget.