Cart & Checkout
Overview
The Antelope Pets theme uses two cart implementations:
- Mini cart (drawer cart) -- Vue.js
<cart>component (src/vue/components/Cart/index.vue) rendered in the header, slides out when items are added - 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:
- 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) - Header -- "Your basket" + item count, close button
- 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 - Gift note -- textarea (150 chars, emoji filtered) when
enable_noteis on (currently off) - Gift with Purchase -- progress bar and gift list when
gwp_enabledis on (currently off) - 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 - Subtotal block -- subtotal, free-shipping progress bar, Savings line, discount code field, Checkout button
- Empty state --
emptyCartLabeland 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.
| Theme | Current upsell products |
|---|---|
| Theme A (live) | fantasy-football-fuel, phantom-feast-2-pack, spiced-cider-2-pack, 2026-berry-skus, bocces-protein-cuts |
| Theme B | bocces-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 Prop | Description |
|---|---|
addGWPtoCart(variantId) | Function to add a GWP product to cart |
cartHasGWP, cartHasGWP1, cartHasGWP2 | Boolean flags indicating if each GWP is already in cart |
spend, spend1, spend2 | Boolean flags indicating if each tier threshold is met |
spendDissable1, spendDissable2 | Boolean 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.jsetc. 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;
keyAliasesmaps 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.jscall (the line keeps its properties and position) - Rows keep a stable
viewKeyacross 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.").
| Setting | ID | Current Value |
|---|---|---|
| Free shipping amount | free_shipping_amt | $35 |
Gift with Purchase (GWP) -- Detailed
How It Works
The GWP system is a multi-tier promotional tool:
- Cart empty -- Shows
gwp_empty_cart_text: "Spend $50 to get your free gift" - 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) - Threshold 1 reached -- Shows
gwp_congrats_text: "Add your free gift below!" and displays the gift product(s) with "Add" buttons - Gift claimed -- Shows
gwp_added_gift_text: "You have claimed your free gift!" - Subscription in cart -- Shows
gwp_subscription_in_cart: "** Free gift is not valid with Subscriptions 😦 **"
Configuration Summary
| Setting | ID | Current Value |
|---|---|---|
| Enabled | gwp_enabled | No (disabled) |
| Gift product 1 | gwp_product | bone-broth-soft-chewy-gwp |
| Gift product 2 | gwp_product_1 | (empty) |
| Gift product 3 | gwp_product_2 | (empty) |
| Variant index 1 | variant | 0 |
| Line item top text | gwp_line_item_type | "Free Gift" |
| Line item disclaimer | gwp_line_item_disclaimer | "Discount applied at checkout" (default) |
| Threshold 1 | gwp_threshold | $50 |
| Threshold 2 | gwp_threshold_ | $0 (not set) |
| Discount code 1 | gwp_discount_code | "GWP 1" |
| Discount code 2 | gwp_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_notificationmessage appears above the subtotal
Cart Notes (Gift Note)
An optional text field in the cart for customers to add a gift note.
| Setting | ID | Current Value |
|---|---|---|
| Note label | note_lable | "Is This a Gift? Add a Note!" |
| Note placeholder | note_placeholder | "Enter a message for your lucky, furry friend here." |
| Enable note | enable_note | No (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:
| Element | Setting | Current Value |
|---|---|---|
| Image | emptyCart | emptyCart.jpg (image currently commented out in the drawer) |
| Message | emptyCartLabel | "Your basket is empty. Go get something nice for your pet." |
| Link 1 | emptyCartLink / emptyCartLinkUrl | "Shop Treats" -> /collections/shop-all-treats |
| Link 2 | emptyCartLink1 / emptyCartLinkUrl1 | "Shop Dental" -> /collections/shop-all-dental |
| Link 3 | emptyCartLink2 / 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:
| Setting | Value |
|---|---|
| Logo | Antelope Pets logo (Logo.jpg) |
| instagram.com/antelopepets | |
| TikTok | tiktok.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).