Fixes · Cart drawer
‘Default Title’ shows under products in the cart drawer
The fix
A product with no options still has one variant, and Shopify gives it the option value “Default Title”. Themes hide it with a check, but a cart drawer is often drawn twice: by Liquid when the page loads and by a script after each add. If only one of them has the check, the name appears after an add and goes away on a reload.
Put the check in both. In Liquid, item.product.has_only_default_variant; in the script, item.product_has_only_default_variant from /cart.js.
01Where “Default Title” comes from
Shopify’s cart API shows what a product with no options looks like in the cart: "variant_title": null, "variant_options": ["Default Title"] and "product_has_only_default_variant": true (Shopify, Cart API reference). Code that prints the first option without checking prints “Default Title”.
- 01
Two renderers, one check
Liquid draws the drawer on page load; a script redraws it from
/cart.jsafter an add. If the check was only added on the Liquid side, the drawer looks right on load and after a reload, and wrong the moment something is added. - 02
A check on the wrong thing
A check like
unless item.variant.title contains 'Default'hides a real option with that word in it.has_only_default_variantsays what you mean. - 03
A second option that isn’t there
Script that prints
variant_options[0]andvariant_options[1]prints the word “undefined” for a product with one option. - 04
The same gap in other places
On this thread (May 2022), a sticky add-to-cart bar built from a guide showed “Default Title” for products with one variant. On this one, started in 2019, people still asked in 2022 how to remove it from product pages, and one reply hides it with CSS. Hiding covers only the places the CSS matches.
02Put the same check in both places
For store owners: is it the drawer’s script?
Add a product with no sizes or colours
If “Default Title” shows under its name in the drawer, reload the page and open the drawer again.
Gone after the reload?
Then the theme draws the drawer twice and the script’s copy has no check. It’s a small code fix: send your developer the product link.
Still there after the reload?
Then the theme has no check in either place, or draws the drawer only by script. It’s the same small fix, in the one place it is drawn: send your developer the product link.
For developers: the same check in both renderers
{%- unless item.product.has_only_default_variant -%}
{%- for option in item.options_with_values -%}
<div class="cart-item__option">{{ option.name }}: {{ option.value }}</div>
{%- endfor -%}
{%- endunless -%}function escapeHtml(text) {
const div = document.createElement('div');
div.textContent = text;
return div.innerHTML;
}
function optionsHtml(item) {
if (item.product_has_only_default_variant) return '';
return (item.options_with_values || [])
.map((o) => '<div class="cart-item__option">' + escapeHtml(o.name) + ': ' + escapeHtml(o.value) + '</div>')
.join('');
}- Key it on
product_has_only_default_variant(orvariant_title, which isnullfor these products) rather than matching the text. - Loop over
options_with_valuesinstead of reading fixed positions, so a product with one option never prints “undefined”. - Best: don’t build cart markup in the script at all. Ask Shopify for the drawer’s section with the
sectionsparameter on/cart/add.jsor/cart/change.js, and swap in what comes back, so Liquid is the only renderer (Shopify, Section Rendering API). Dawn’s drawer is drawn this way, with the samehas_only_default_variantcheck (Dawn, cart-drawer.liquid).
03Add products with none, one and two options
Add a product with no options
Nothing under its name in the drawer, before and after a reload.
Add one with one option, then one with two
Each shows its own options, and never “undefined” (search the page source for it too: it can be printed into a hidden element).
Look at the other places
The cart page, a sticky add-to-cart bar, a quick view, and any upsell inside the drawer.
From our work
04A cart drawer drawn twice
On a wellness brand’s store we look after, products with no options showed “Default Title” under their names in the cart drawer, but only once something had been added.
The cause (15 Jul 2026). The drawer had two renderers. The Liquid one already skipped the name. The script that redrew the drawer from /cart.js after an add printed the first option for every product. It also printed a second option for every product, so products without one put the word “undefined” into a hidden element.
The fix (15 Jul 2026). The script now draws the option lines only when the product has a real variant (variant_title is set), and the second line only when there is a second option. The drawer looks the same on load and after an add.
Right after a reload, wrong after a click: the same two-renderer pattern is behind a compare-at price that disappears when you change size.
- In our log, written up“Cart drawer no longer shows Default Title under products without options”
05Sources
Every step and claim above comes from one of these, or from the fix on the store it describes.
- Shopify developers: Cart API reference
- Shopify developers: Liquid objects, product (has_only_default_variant)
- Shopify developers: Section Rendering API
- Shopify Dawn theme: snippets/cart-drawer.liquid
- Shopify Community: How can I change the Default Title text on my sticky add to cart button? (May 2022)
- Shopify Community: How can I remove Default Title from product page (2019 to 2022)
Sources checked on .
