Skip to content

Cart & Checkout ​

Overview ​

The Antelope Pets theme uses two cart implementations:

  1. Mini cart (drawer cart) -- Vue.js <cart> component (src/vue/components/Cart/index.vue) rendered in the header, slides out when items are added
  2. Full cart page -- Vue.js <cartpage> component (src/vue/components/Cart/cartpage.vue) on /cart

Both read cart data from the helper-cart-js snippet, share the Vuex store src/vue/store/cart.js, and use the same theme settings for upsell products, GWP, and free shipping.

Theme A and Theme B run the same drawer and cart page; they differ only in the configured upsell products (see Upsell Products).


Mini Cart (Drawer Cart) ​

Rendered in: sections/layout-header.liquid

<cart
  :cart="helper-cart-js"
  upsale_products="helper-upsale-products (settings.upsale)"
  :anouncements="[settings.announcementLabel / announcementLink, ...Label2 / Link2]">
  #gwplist slot (GWP products)
</cart>

Drawer contents, top to bottom:

  1. Announcement slider -- up to 2 messages from Theme Settings > Cart (announcementLabel / announcementLink, announcementLabel2 / announcementLink2), shown as a <promo> slider. Hidden when both labels are blank (currently blank)
  2. Header -- "Your basket" + item count, close button
  3. Line items -- <cart-item> rows (vendor, title, variant, price/compare-at, quantity stepper, Remove). Subscription lines show a "% Off" badge and a delivery-frequency dropdown; one-time lines that have selling plans show "+ Subscribe and Save 10%", which switches the line to the first plan in place
  4. Gift note -- textarea (150 chars, emoji filtered) when enable_note is on (currently off)
  5. Gift with Purchase -- progress bar and gift list when gwp_enabled is on (currently off)
  6. Upsell -- "You might also like" (upsale_headline) as a one-per-slide carousel when the cart has items; when the cart is empty the heading switches to "Shop Best Sellers" (upsale_headline_best_sellers) and the products are listed vertically
  7. Subtotal block -- subtotal, free-shipping progress bar, Savings line, discount code field, Checkout button
  8. Empty state -- emptyCartLabel and up to 3 link buttons

Savings Line ​

Shows the total saved across lines: (compare-at price - discounted price) x quantity, using the product's compare-at price, or the subscription plan's compare-at price for subscription lines. When the subtotal is above the free-shipping threshold it appends "+ free shipping!".

Discount Code ​

Component: src/vue/components/Cart/DiscountCode.vue (used in both drawer and cart page)

An input ("Discount code or gift card") with an APPLY button. The applied cart-level discount shows as a navy pill with its title; errors show in red below the field.

Upsell Products ​

Snippet: snippets/helper-upsale-products.liquid · Component: src/vue/components/Cart/UpsaleItem.vue

The upsell list comes from settings.upsale (limit 5). Products tagged internal_only or with the metafield custom._hide_product_in_plp are flagged hidden. Each item has image, title, price and an Add button (or Sold). The helper also passes each variant's selling plans, vendor and compare-at price so an added item appears in the drawer instantly.

ThemeCurrent upsell products
Theme A (live)fantasy-football-fuel, phantom-feast-2-pack, spiced-cider-2-pack, 2026-berry-skus, bocces-protein-cuts
Theme Bbocces-wellness-biscuits, bocces-grazers-jerky-sticks, bocces-brushy-sticks-dental-bars, bocces-everyday-soft-chewy-treats, supersnouts-joint-power

Gift with Purchase (GWP) in Mini Cart ​

When GWP is enabled (gwp_enabled: true), the mini cart renders a GWP gift list via a scoped slot (#gwplist). The slot receives reactive data from the Vue component:

Slot PropDescription
addGWPtoCart(variantId)Function to add a GWP product to cart
cartHasGWP, cartHasGWP1, cartHasGWP2Boolean flags indicating if each GWP is already in cart
spend, spend1, spend2Boolean flags indicating if each tier threshold is met
spendDissable1, spendDissable2Boolean flags to disable tier 2/3 buttons

Up to 3 GWP products are rendered with:

  • Product image and title (linking to product page)
  • "Add" button (changes to "Added" when in cart, or "Sold" when out of stock)
  • Conditional display based on whether the spend threshold is met

Optimistic Cart Updates ​

Store: src/vue/store/cart.js

The cart applies every change on screen immediately and sends the requests behind it (the same approach as the Super Snouts theme). The shopper can keep tapping the quantity stepper while requests are in flight; rows are not blocked or dimmed while waiting for a response.

How it works:

  • Queued requests -- /cart/add.js, /cart/change.js etc. reach Shopify one at a time (queueCartMutation), so two updates to the same line can't race
  • Optimistic lines -- an add draws the line straight away from data sent with the request (_optimistic: title, variant title, price, compare-at, image, handle, vendor). The PDP, PLP Quick Add and cart upsell all send it
  • Key aliasing -- a line shown before Shopify has created it gets a temporary key; keyAliases maps it to the real key so the shopper can keep pressing + on a line whose add is still in flight
  • Local totals -- subtotal/total are recomputed from the lines; cart-level discounts from the last server response are kept on top so a discount doesn't flicker away
  • Plan switches use a single /cart/change.js call (the line keeps its properties and position)
  • Rows keep a stable viewKey across refreshes, so they update in place instead of re-mounting (no flashing)

When editing the cart store

Any new "add to cart" entry point should pass an _optimistic object (see optimisticLine() in src/vue/components/PDP/index.vue or the click handler in assets/quick-add.static.js). Without it the line only appears after the background /cart.js refresh.


Full Cart Page ​

Section file: sections/main-cart.liquidTemplate: templates/cart.json

The full /cart page uses the <cartpage> Vue component with cart data from helper-cart-js. It has the same line items, free-shipping bar, Savings line and discount code field as the drawer.

Upsell Products (Cart Page) ​

Rendered via the #upsale scoped slot. Each upsell product from settings.upsale shows:

  • Product thumbnail image
  • Product title
  • Price
  • "Add" button (calls addUpsale(variantId))
  • Shows "Sold" button if variant is unavailable

GWP on Cart Page ​

Rendered via the #gwplist scoped slot. Similar to the mini cart GWP but with a simpler single-tier display (only gwp_product is shown, using variants[0]).


Free Shipping Progress Bar ​

Both the mini cart and cart page display a progress bar showing how much more the customer needs to spend for free shipping ("You are $X away from free shipping!" / "Congrats! You get free shipping.").

SettingIDCurrent Value
Free shipping amountfree_shipping_amt$35

Gift with Purchase (GWP) -- Detailed ​

How It Works ​

The GWP system is a multi-tier promotional tool:

  1. Cart empty -- Shows gwp_empty_cart_text: "Spend $50 to get your free gift"
  2. Below threshold -- Shows gwp_approaching_text: "Only $[XX] away from free gift!" (the [XX] placeholder is dynamically replaced with the remaining dollar amount by the Vue component)
  3. Threshold 1 reached -- Shows gwp_congrats_text: "Add your free gift below!" and displays the gift product(s) with "Add" buttons
  4. Gift claimed -- Shows gwp_added_gift_text: "You have claimed your free gift!"
  5. Subscription in cart -- Shows gwp_subscription_in_cart: "** Free gift is not valid with Subscriptions 😦 **"

Configuration Summary ​

SettingIDCurrent Value
Enabledgwp_enabledNo (disabled)
Gift product 1gwp_productbone-broth-soft-chewy-gwp
Gift product 2gwp_product_1(empty)
Gift product 3gwp_product_2(empty)
Variant index 1variant0
Line item top textgwp_line_item_type"Free Gift"
Line item disclaimergwp_line_item_disclaimer"Discount applied at checkout" (default)
Threshold 1gwp_threshold$50
Threshold 2gwp_threshold_$0 (not set)
Discount code 1gwp_discount_code"GWP 1"
Discount code 2gwp_discount_code_(empty)

Important: The discount code is NOT automatically applied by the theme. The GWP product is added to the cart, and the discount is reflected at Shopify checkout when the matching discount code is applied. The mini cart shows a disclaimer: "**Free gift discount reflected after clicking checkout".

GWP and Subscriptions ​

GWP is explicitly incompatible with subscription (ReCharge) products. When a subscription product is in the cart:

  • The GWP progress bar shows the subscription warning message
  • The gwp_mini_cart_removal_notification message appears above the subtotal

Cart Notes (Gift Note) ​

An optional text field in the cart for customers to add a gift note.

SettingIDCurrent Value
Note labelnote_lable"Is This a Gift? Add a Note!"
Note placeholdernote_placeholder"Enter a message for your lucky, furry friend here."
Enable noteenable_noteNo (disabled)

When enabled, the note is saved as the cart note and included with the order.


Empty Cart State ​

When the cart is empty, customers see:

ElementSettingCurrent Value
ImageemptyCartemptyCart.jpg (image currently commented out in the drawer)
MessageemptyCartLabel"Your basket is empty. Go get something nice for your pet."
Link 1emptyCartLink / emptyCartLinkUrl"Shop Treats" -> /collections/shop-all-treats
Link 2emptyCartLink1 / emptyCartLinkUrl1"Shop Dental" -> /collections/shop-all-dental
Link 3emptyCartLink2 / emptyCartLinkUrl2"Shop Wellness" -> /collections/shop-all-wellness

Below the empty state the drawer shows the upsell products under "Shop Best Sellers".


Checkout ​

Checkout uses Shopify's native checkout system. Custom branding is configured in Shopify Admin > Settings > Checkout:

SettingValue
LogoAntelope Pets logo (Logo.jpg)
Instagraminstagram.com/antelopepets
TikToktiktok.com/@antelopepets

Checkout Savings extension

This theme does not set a _theme_id cart attribute and does not read a custom.shipping_cost metafield, so there is no theme-side wiring for the Checkout Savings extension here.


Mini Cart Section ​

Section file: sections/mini-cart.liquid

A minimal section containing just the <store-cart /> Vue component. This appears to be an alternative/standalone mini cart implementation.


Cart Data Helper ​

Snippet: snippets/helper-cart-js.liquid

Prepares cart data as a JSON-compatible string for Vue components. Both the <cart> (mini cart) and <cartpage> (full cart) components receive this data as their :cart prop (settings for upsell, GWP, free shipping, note and empty state are included).

Upsell Data Helper:

Snippet: snippets/helper-upsale-products.liquid

Prepares the upsell product list from settings.upsale as a prop-compatible string for the mini cart's upsale_products attribute (see Upsell Products).

Antelope Themes Documentation

Enter the password to access this site.