Skip to content

Cart & Checkout ​

Overview ​

PieceFileTech
Cart drawer shellshopify/snippets/cart-mini.liquid (included in layout/theme.liquid)Liquid + Vue islands
Cart drawer bodyshopify/templates/cart.mini.liquid → store-cartVue (src/vue/components/Cart/)
Cart statesrc/vue/store/cart.js, src/vue/store/gwp.jsVuex
Full cart pageshopify/templates/cart.liquid → static-cartLiquid
AJAX cart templatecart._ajax.liquidLiquid

Theme B only

Theme B also has templates/cart.mini-backup.liquid and snippets/cart-mini-backup.liquid, backup copies of the drawer. Nothing references them.

Cart Drawer ​

The drawer slides in from the header cart icon. Top to bottom:

  1. Announcement strip (announcement-cart): a rotating slider on a #fae0ce background. It shows the three Cart → Announcement labels from theme settings. If those are empty (the current setup), it reuses the header announcement bar blocks through window.Shopify.announcement. Hidden when show_announcement is off.
  2. GWP progress bar and "Add your free gift" row, when GWP is on. See Gift with Purchase.
  3. Item count + close button.
  4. Line items (cart-item), or the empty state (emptyCartLabel / subEmptyCartLabel).
  5. Upsell carousel: the headline is upsale_headline when the cart has items and upsale_headline_best_sellers when it's empty. When empty, a Shop Now button links to /collections/shop-all.
  6. Subtotal, free-shipping progress bar, Savings row, Checkout button (/checkout).

Line items ​

Each line (src/vue/components/Cart/CartItem.vue) shows:

  • image, title and price. If the line has a compare-at price above the price (from the product JSON or the selling plan), the compare-at price shows struck through and a 10% OFF badge sits on the image;
  • a quantity stepper and a remove (trash) icon. The free gift has no stepper;
  • a selling-plan dropdown for subscription lines, to switch delivery frequency;
  • "+ Update To Subscribe And Save 10%" on one-time lines whose product has selling plans. It converts the line to the first plan.

The product details (compare-at price, selling plans) come from /products/{handle}.js and are cached per variant.

Upsell / best sellers ​

  • Source: the upsale product list (max 5), serialised by snippets/helper-best-sellers.liquid.
  • The carousel skips products already in the cart and unavailable products.
  • Each card has an Add button that adds the first variant. It shows compare-at pricing if set.

Free shipping bar ​

Shown when the cart has items and free_shipping_amt > 0 (currently $50). The copy reads "You are $X away from free shipping!" until the threshold, then "Congrats! You get free shipping."

Savings row ​

"Savings" under the subtotal is the sum over lines of:

  • regular lines: (compare-at price − discounted price) × quantity, where the compare-at price comes from the variant, or the selling plan's compare-at price for subscription lines;
  • the free gift (GWP line): its full original price × quantity.

How the free gift is detected

A gift product has no compare-at price of its own, so the gift line counts at its full original price. The gift row label (price struck through) and the Savings total use the same rule, isGwpLine() in src/utils/cart-line.js: a line is the gift if it has a _gwp property.

Instant cart updates ​

Every cart change shows on screen immediately and the request goes out in the background. The behaviour matches the Super Snouts cart. A second tap while a request is in flight is queued, not ignored.

How it works (src/vue/store/cart.js):

  • Requests reach Shopify one at a time. A mutation queue chains them so two updates to the same line can't race.
  • A newly added line gets a temporary key until /cart/add.js answers. Queued requests resolve it to the real key, so the buyer can press + on a line that is still being added.
  • Totals are recomputed locally. Cart-level discounts from the last server response are applied on top, so a discount doesn't flicker away.
  • A failed request (non-2xx) rolls the change back.
  • The header count (the [data-cart-mini-count] element) is kept in sync by the store.

The theme's own Add to cart buttons pass the row data in, so the new line appears before Shopify responds. This covers the PDP (from the product JSON), the persistent ATC bar, product cards (including the NFLPA PLP grid), the GWP row and upsell cards. Search-result buttons and NFLPA player cards don't pass row data, so their row appears once Shopify responds.

How the row data is passed:

  • Liquid buttons render snippets/helper-optimistic-attrs.liquid (data-line-* attributes: title, variant, price in cents, compare-at, image, handle, SKU, selling plans).
  • Vue buttons use snippets/helper-optimistic-json.liquid (the same fields as JSON).
  • Both go through window.__bocces.addToCart(item, line), defined in src/entrypoints/main.js.

Adding a new add-to-cart button

Render helper-optimistic-attrs on it, passing the same product / variant the button submits. Without it the add still works, but the row only appears once Shopify responds. Keep prices in cents: output of the money filter can't be used for a row.

Gift with Purchase (GWP) ​

Configured in Theme Settings → Gift with Purchase. See settings table. Currently on, with a $60 threshold.

StepBehaviour
Qualifying totalSum of one-time (non-subscription) line prices, excluding the gift itself. With gwp_one_time_price on, each product is counted once, whatever its quantity
Progress copygwp_empty_cart_text → gwp_approaching_text ([XX] = amount left) → gwp_congrats_text → gwp_added_gift_text
ClaimingAbove the threshold, a gift row with Add to cart appears. Clicking it adds gwp_product (first variant) with the line property _gwp: true, then calls /discount/{gwp_discount_code} so the code is applied at checkout
Dropping belowIf the qualifying total falls under the threshold, the gift line is removed automatically
SubscriptionsWith a subscription line in the cart (detected by the ReCharge shipping_interval_frequency / shipping_interval_unit_type line properties), the bar shows gwp_subscription_in_cart and the drawer shows gwp_mini_cart_removal_notification above the subtotal
WholesaleCustomers tagged wholesale never see the GWP bar or row

WARNING

GWP is not valid with Subscribe & Save orders. The price is taken off by the discount code at checkout: in the drawer, the gift row shows its price struck through, and gwp_mini_cart_disclaimer explains this.

Cart Notes ​

SettingCurrent Value
Enable drawer notes (enable_cart_drawer_notes)Disabled
Note label"Is This a Gift? Add a Note!"
Note placeholder"Enter a message for your lucky, furry friend here."

When enabled, the note field renders in the drawer footer (cart.mini.liquid, data-html="footer") next to any cart-level discounts.

Full Cart Page ​

Section file: static-cart.liquid (template cart.liquid). The server-rendered cart page. Current settings: breadcrumbs off, note on, shipping calculator off.

Checkout ​

Checkout is Shopify-hosted. The theme's influence ends at the drawer's Checkout button.

  • Branding: configure it in Settings → Checkout → Customize. The checkout_* keys in settings_data.json are legacy and have no effect. See Theme Settings.
  • Checkout Savings extension: the Bocce's theme does not write the _theme_id cart attribute, and doesn't reference a custom.shipping_cost shop metafield. If the Checkout Savings block is placed in Bocce's checkout, leave its Theme ID setting blank: a cart without _theme_id never matches a Theme ID filter. The drawer's Savings row is a separate, theme-side calculation.

Antelope Themes Documentation

Enter the password to access this site.