一键导入
cart
Configure the Cart V2 drawer — add upsells, progress bars, conditional rules, announcement banners, and checkout customization
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Configure the Cart V2 drawer — add upsells, progress bars, conditional rules, announcement banners, and checkout customization
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze a specific component on any webpage and output a renderer-compatible island layout JSON. Use when reverse-engineering a hero, FAQ, nav, product card, or any UI component into a reusable Lexsis layout.
Route broad or multi-step Lexsis storefront work to focused skills, MCP tools, and reference knowledge. Do not use when a focused workflow skill clearly matches.
Core orchestrator for Lexsis AI storefront page generation. Routes requests to the correct workflow, manages tool sequencing, and loads reference knowledge on demand. Auto-invoked by commands and agents.
Use Codex Browser to analyze a URL for design extraction, CRO evidence, or competitor research. Use when a task provides a reference or storefront URL.
Analyze a reference webpage into a reproducible Lexsis design brief. Use for competitor or inspiration URLs; not for an existing-page CRO audit.
Set up A/B tests, personalization variants, and monitor experiment results — hypothesis-driven testing with statistical significance tracking
| name | cart |
| description | Configure the Cart V2 drawer — add upsells, progress bars, conditional rules, announcement banners, and checkout customization |
Configure the Cart V2 drawer — add upsells, progress bars, conditional rules, announcement banners, and checkout customization
Compose a Cart V2 drawer using atomic islands inside a DrawerShell container. Use when store has cart_v2 enabled.
Cart V2 replaces the monolithic CartDrawer with composable islands that each handle one responsibility. The drawer HTML lives in store-level config (cart_sections array), shared across all pages. Islands read runtime data from the store's commerce_config at hydration time.
Cart V2 pages set head.use_cart_v2: true ONLY. No cart section appears in the page sections array.
{
"head": {
"title": "...",
"use_cart_v2": true
}
}
The renderer injects the cart HTML (from store config) after page sections at render time. Manage via get_cart_config and update_cart_config MCP tools.
Minimum required islands inside DrawerShell:
CartLines — line itemsCartCheckoutButton — checkout CTAValidation fails without both.
| Island | Purpose | Key Props |
|---|---|---|
DrawerShell | Container / drawer chrome | trigger (event name, default "cart:open") |
CartLines | Line items with qty controls | — |
CartCheckoutButton | Checkout CTA | text? |
CartSummary | Subtotal / taxes / total | — |
CartProgressBar | Free shipping / tiered progress | threshold?, message?, completedMessage?, tiers?, currency? |
CartDiscountInput | Promo code field | placeholder? |
CartCrossSell | Upsell recommendations | heading?, max?, layout?, showQuickAdd? |
DO NOT use CartAnnouncement, CartOrderNote, or CartCountdown — these are unimplemented.
CartCrossSell is self-managing. It reads product recommendations from commerce_config.upsells at the store level. There is NO source prop.
Props (all optional):
heading — section heading text (e.g. "Complete Your Routine")max — maximum products to show (default determined by config)layout — "horizontal" | "grid" | "stack"showQuickAdd — boolean, show inline add-to-cartProduct IDs in commerce_config.upsells must be Shopify GIDs: gid://shopify/Product/...
For config-driven defaults, use empty props:
<div data-island="CartCrossSell" data-props='{}'></div>
For display overrides:
<div data-island="CartCrossSell" data-props='{"heading":"You May Also Like","max":3,"layout":"horizontal","showQuickAdd":true}'></div>
CartProgressBar self-manages visibility. It falls back to $cartConfig.free_shipping_threshold when no threshold prop is passed.
Props (all optional):
threshold — target amount in cents (overrides store config)message — template string, use {remaining} placeholdercompletedMessage — shown when threshold mettiers — array of { threshold, label } for multi-tier progresscurrency — currency code (falls back to store currency)Config-driven (reads threshold from store config):
<div data-island="CartProgressBar" data-props='{}'></div>
Explicit threshold:
<div data-island="CartProgressBar" data-props='{"threshold":7500,"message":"Add {remaining} for free shipping!","completedMessage":"Free shipping unlocked!"}'></div>
Multi-tier:
<div data-island="CartProgressBar" data-props='{"tiers":[{"threshold":5000,"label":"Free shipping"},{"threshold":10000,"label":"10% off"},{"threshold":15000,"label":"Free gift"}]}'></div>
data-island-container attribute — prevents children from hydrating on page load.trigger prop is an event name (default "cart:open"). It is NOT triggerId.data-props='{}'.head.use_cart_v2: true flag.Complete DrawerShell HTML for a store config:
<div data-island="DrawerShell" data-island-container data-props='{"trigger":"cart:open"}'>
<div class="p-4 border-b">
<div data-island="CartProgressBar" data-props='{"threshold":7500,"message":"Add {remaining} for free shipping!","completedMessage":"Free shipping unlocked!"}'></div>
</div>
<div class="flex-1 overflow-y-auto p-4">
<div data-island="CartLines" data-props='{}'></div>
</div>
<div class="p-4 border-t">
<div data-island="CartCrossSell" data-props='{"heading":"Complete Your Routine","max":2,"layout":"horizontal","showQuickAdd":true}'></div>
</div>
<div class="p-4 border-t">
<div data-island="CartDiscountInput" data-props='{"placeholder":"Promo code"}'></div>
</div>
<div class="p-4 border-t bg-gray-50">
<div data-island="CartSummary" data-props='{}'></div>
<div data-island="CartCheckoutButton" data-props='{"text":"Checkout"}'></div>
</div>
</div>
| Anti-Pattern | Why It Breaks |
|---|---|
Using triggerId on DrawerShell | Prop is trigger (event name string), not triggerId |
Passing source to CartCrossSell | No source prop exists — reads from commerce_config.upsells |
| Using CartAnnouncement / CartOrderNote / CartCountdown | Unimplemented islands — will not render |
Missing data-island-container on DrawerShell | Children hydrate immediately on page load (perf hit) |
| Putting cart section in page sections array | Cart V2 lives in store config only; page sets head.use_cart_v2: true |
| CartDrawer + DrawerShell on same page | Validation error — pick one |
| No CartLines or CartCheckoutButton | Validation blocks publish |
How to read, modify, and validate store-level cart configuration using MCP tools.
The actual API response from get_cart_config:
{
"id": "uuid",
"store_id": "uuid",
"cart_mode": "drawer-right",
"cart_sections": [{"id": "cart-drawer", "html": "...", "css": "...", "js": "..."}],
"cart_rules": [...],
"commerce_config": {
"free_shipping_threshold": 7500,
"currency": "USD",
"upsells": [{"trigger_product_ids": ["gid://shopify/Product/123"], "recommend_product_ids": ["gid://shopify/Product/789"], "label": "Complete your routine"}],
"cart_style": {"mode": "drawer-right", "responsive": {"mobile": "bottom-sheet"}, "width": "420px", "animate": "spring"},
"checkout_mode": "standard"
}
}
get_cart_configRead current config. Always call first.
Params: store_id (UUID)
update_cart_configPartial update. Validates rules before persisting.
Params:
store_id (UUID, required)cart_mode (optional)cart_sections (optional, array of {id, html, css?, js?})cart_rules (optional, array)commerce_config (optional, object)validate_cart_rulesDry-run validation. Does not persist.
Params:
store_id (UUID)rules (array)Returns: {valid, errors[]}
get_cart_config to read current statecommerce_config for thresholds/upsells, cart_sections for HTML, cart_rules for conditional logic)update_cart_config with only the changed fieldsfree_shipping_threshold, CartCrossSell reads upsellscommerce_config.upsells:{"trigger_product_ids": ["gid://shopify/Product/123"], "recommend_product_ids": ["gid://shopify/Product/789"], "label": "Complete your routine"}
update_cart_config with updated commerce_configcommerce_config.free_shipping_threshold to new value (cents)update_cart_config with updated commerce_configcart_rulesvalidate_cart_rulesupdate_cart_config with updated cart_rulesCall update_cart_config with cart_mode: "bottom-sheet" (or other valid mode).
cart_sections is a JSONB array (not a string) — same structure as page sectionsgid://shopify/Product/XXX)trigger_product_idscommerce_config — islands read it live