Skip to main content

My theme is breaking the gift line

Symptoms: the gift line shows fine in the simulator and on the cart page, but disappears from the cart drawer. Or it appears but the quantity is editable. Or _vltrx_campaign_id isn't on the line at all when you inspect /cart.js.

Almost always: a third-party cart-drawer app, or theme JavaScript, is rebuilding the cart HTML and stripping line attributes Valotrix Cart Rewards needs. This page is how to confirm that and fix it.

Symptoms​

If any of these match, you're in the right article:

  • Gift line appears on the cart page (/cart) but missing from the cart drawer.
  • Customer can change the gift's quantity even though you have Gift line display → quantity lock turned on.
  • Inspecting /cart.js in the browser shows the gift line has no _vltrx_campaign_id property - or no line properties at all.
  • Removing other items removes the gift correctly, but adding items doesn't re-add the gift even though the cart still matches the threshold.
  • Cart drawer doesn't show the "Free" label even though the setting is on in the admin.

Quick diagnosis (60 seconds)​

Open a fresh tab on your storefront. Add the trigger product, cross the threshold, then open this URL in the same tab:

https://yourshop.com/cart.js

Read the JSON. Find the gift line (it'll have the gift product's title or variant ID). Look at its properties field:

{
"properties": {
"_vltrx_campaign_id": "clxabc123",
"_vltrx_rule_id": "ruleabc",
"_vltrx_discount_method": "automatic",
"_vltrx_discount_title": "FREE GIFT",
"_vltrx_lock_quantity": "true"
}
}

_vltrx_campaign_id is the canonical marker - every engine-added gift line has it. _vltrx_rule_id is always present too; the discount/title/lock properties only appear when the rule's configuration requires them.

If _vltrx_campaign_id is there, the line is structurally correct - your cart drawer (or theme JS) is filtering or hiding it on render. Fix path B or A.

If _vltrx_campaign_id is missing entirely, something is stripping line properties before they hit Shopify's cart. Fix path A.

If the gift line itself is missing, see Gift not added instead - the engine didn't add it in the first place.

Common offenders​

These are the third-party tools and theme behaviors that most often break Valotrix Cart Rewards gift lines. The pattern is the same: they re-render cart HTML from scratch and don't preserve the line property attributes.

  • Slide Cart / Cart Drawer apps - apps that replace your theme's native cart drawer with their own. They re-fetch /cart.js and rebuild HTML; if their template doesn't render properties, the gift looks broken.
  • Rebuy cart drawer - Rebuy's drawer surface is its own; same issue.
  • Custom AJAX cart code - themes (often older Brooklyn, Debut, Empire) that hand-rolled their cart drawer JS years ago. They typically only render line.title, line.quantity, and line.price - no properties loop.
  • Aggressive cart-recalc apps - apps that recompute the cart server-side and replace lines wholesale. They strip line properties on every recalc.

If your store uses any of the above, that's almost certainly your problem.

Fix path A - switch to theme app embed only​

The cleanest fix: disable the competing cart-drawer app and use your theme's native cart drawer + Valotrix Cart Rewards's theme app embed.

  1. In Shopify Admin → Apps, identify which app is overriding the cart drawer.
  2. In its settings, disable its storefront output (every cart-drawer app has this toggle, usually called "Enable on storefront" or "Active in theme").
  3. In Shopify Admin → Online Store → Themes → Customize → App embeds, confirm Valotrix Cart Rewards's embed is on and the third-party app's embed is off.
  4. Save the theme. Test the cart drawer.

If you actively need the third-party app for non-cart features (analytics, shipping rules), you don't have to uninstall it - just disable its cart-drawer rendering.

Fix path B - structural cart row in your theme​

If you want to keep your current cart drawer and your theme is reasonably modern, the fix is usually just confirming your cart rows include the data-key or data-cart-item-key attribute that Valotrix Cart Rewards uses to locate gift lines.

Modern themes do this by default:

  • Dawn - every cart row has data-key="{{ item.key }}". Works.
  • Refresh - same. Works.
  • Sense - same. Works.
  • Studio, Crave, Origin, Pipeline - all good.

Older themes that may need a patch:

  • Brooklyn, Debut, Boundless, Minimal, Supply - cart rows often lack the data attribute. Add data-key="{{ item.key }}" to the cart-item element in sections/cart-template.liquid and snippets/cart-drawer.liquid (or equivalents).

If you're not comfortable editing Liquid, fix path C.

Fix path C - contact us​

Email valentin@valotrix.com with:

  • Your Shopify store URL.
  • Your theme name (Online Store → Themes → name shown under the live theme).
  • The output of https://yourshop.com/cart.js when the gift line is broken (paste the JSON).
  • A screenshot of the broken cart drawer.
  • Which cart-drawer app you're using, if any.

Solo founder support, EU business hours; same-day response on weekdays. Most theme-break cases are resolved with a one-line theme edit or by toggling the right app embed.


Next: Buy Now / Shop Pay bypass →