Token导航 LogoToken导航TokenDH.com
开发操作浏览器github未标认证来源可访问许可证需确认审计异常

shopify-checkout-extensionsShopify checkout extensions 命令行

Agent Skill

shopify-checkout-extensions 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

494

周安装

20

GitHub Stars

19

下载量

155
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:shopify-checkout-extensions(Shopify checkout extensions 命令行)
来源仓库:https://github.com/finsilabs/awesome-ecommerce-skills
仓库路径:skills/shopify-checkout-extensions
安装命令:
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill shopify-checkout-extensions
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill shopify-checkout-extensions

简介

用于处理 Shopify 结账扩展相关的 GitHub 仓库、Issue 和代码协作信息。

  • 适合在开发或集成 Shopify 结账扩展功能时,整理代码变更和协作事项。
  • 通过 npx skills add 命令从指定仓库安装,需确认权限范围和是否涉及文件读写操作。
  • 建议结合原始 README 和项目结构进一步核验具体功能和使用场景。
  • 注意维护状态和网络访问权限,避免触发不必要的命令执行或数据修改。

SKILL.md

Shopify Checkout Extensions

Overview

Shopify Checkout Extensions allow apps to render custom UI blocks inside Shopify's checkout without forking the checkout template. Shopify Functions let you replace backend logic — discounts, shipping, payment methods, and order validation — with custom WebAssembly modules that run inside Shopify's infrastructure. Together they replace the deprecated checkout.liquid customization approach and work with both Shopify Plus and non-Plus stores (UI extensions) or Plus-only (some Functions targets).

When to Use This Skill

  • When adding custom UI blocks to checkout (upsells, trust badges, gift message fields, warranty options)
  • When implementing custom discount logic beyond native Shopify discount rules (e.g., tiered discounts, B2B pricing)
  • When creating custom shipping method filtering or renaming based on cart contents
  • When building payment customization to hide/rename payment methods for specific customers
  • When validating order contents before checkout completes (e.g., quantity limits, region restrictions)
  • When replacing deprecated checkout.liquid customizations for Shopify Plus stores

Core Instructions

  1. Scaffold an extension with Shopify CLI # Inside an existing Shopify app directory shopify app generate extension # Choose: Checkout UI extension OR Shopify Function # Name: my-checkout-extension This creates an extensions/my-checkout-extension/ directory with src/index.tsx (UI) or src/index.ts (Function).
  2. Build a Checkout UI extension Checkout UI extensions use a React-like component API from @shopify/ui-extensions-react/checkout: // extensions/order-upsell/src/index.tsx import {reactExtension, useCartLines, useApplyCartLinesChange, useSettings, BlockStack, Button, Image, Text, InlineStack, Divider,} from "@shopify/ui-extensions-react/checkout"; const CheckoutBlock = reactExtension("purchase.checkout.block.render", () => <OrderUpsell />); export {CheckoutBlock}; function OrderUpsell() {const cartLines = useCartLines(); const applyCartLinesChange = useApplyCartLinesChange(); const {upsell_variant_id: upsellVariantId} = useSettings(); // Only show upsell if a variant is configured and cart doesn't already contain it if (!upsellVariantId) return null; const alreadyInCart = cartLines.some((line) => line.merchandise.id === upsellVariantId); if (alreadyInCart) return null; const handleAddUpsell = async () => {await applyCartLinesChange({type: "addCartLine", merchandiseId: upsellVariantId, quantity: 1,});}; return (<BlockStack spacing="base"> <Divider /> <InlineStack blockAlignment="center" spacing="base"> <Image source="https://cdn.shopify.com/s/files/..." aspectRatio={1} /> <BlockStack> <Text emphasis="bold">Add a gift bag for $3.99</Text> <Text appearance="subdued">Beautiful packaging for your order</Text> </BlockStack> <Button onPress={handleAddUpsell}>Add</Button> </InlineStack> </BlockStack>);}
  3. Configure the extension in shopify.extension.toml api_version = "2025-01" [[extensions]] type = "ui_extension" name = "Order Upsell" handle = "order-upsell" [[extensions.targeting]] module = "./src/index.tsx" target = "purchase.checkout.block.render" [extensions.settings] [[extensions.settings.fields]] key = "upsell_variant_id" type = "variant_reference" name = "Upsell Product Variant"
  4. Build a Shopify Function for custom discounts Shopify Functions compile to WebAssembly. Use Rust or JavaScript: ` // extensions/volume-discount/src/index.ts import type {RunInput, FunctionRunResult, CartLineInput,} from "../generated/api"; const NO_CHANGES: FunctionRunResult = {discounts: [], discountApplicationStrategy: "FIRST"}; export function run(input: RunInput): FunctionRunResult {const {cart} = input; // Calculate total quantity across all lines const totalQuantity = cart.lines.reduce((sum, line) => sum + line.quantity, 0); // Tiered volume discount let discountPercent = 0; if (totalQuantity >= 20) discountPercent = 20; else if (totalQuantity >= 10) discountPercent = 10; else if (totalQuantity >= 5) discountPercent = 5; if (discountPercent === 0) return NO_CHANGES; return {discounts: [{value: {percentage: {value: discountPercent.toString()},}, targets: [{orderSubtotal: {excludedVariantIds: []}}], message: ${discountPercent}% volume discount (${totalQuantity} items),},], discountApplicationStrategy: "FIRST",};} Function shopify.extension.toml: api_version = "2025-01" [[extensions]] type = "function" name = "Volume Discount" handle = "volume-discount" runtime = "javascript" [[extensions.input.variables]] name = "cart" type = "Cart" [extensions.build] command = "npm run build" path = "dist/index.wasm"`
  5. Test and deploy extensions # Run local dev preview (UI extension hot-reloads in checkout) shopify app dev # Open the checkout preview URL shown in terminal # Deploy all extensions to Shopify shopify app deploy After deploying, go to Admin → Checkout → Customize to add the UI extension block to a checkout template. Functions are activated by creating a discount with the function from Admin → Discounts.

Examples

Gift message field using useApplyMetafieldsChange

import {
  reactExtension,
  TextField,
  useApplyMetafieldsChange,
  useMetafield,
  BlockStack,
  Text,
} from "@shopify/ui-extensions-react/checkout";

export default reactExtension(
  "purchase.checkout.shipping-option-list.render-after",
  () => <GiftMessage />
);

function GiftMessage() {
  const giftMessage = useMetafield({ namespace: "custom", key: "gift_message" });
  const applyMetafieldsChange = useApplyMetafieldsChange();

  return (
    <BlockStack spacing="tight">
      <Text emphasis="bold">Gift message (optional)</Text>
      <TextField
        label="Message"
        value={giftMessage?.value ?? ""}
        multiline={3}
        onChange={(value) =>
          applyMetafieldsChange({
            type: "updateMetafield",
            namespace: "custom",
            key: "gift_message",
            valueType: "string",
            value,
          })
        }
      />
    </BlockStack>
  );
}

Payment customization Function (hide cash on delivery for international orders)

// extensions/payment-customization/src/index.ts
import type { RunInput, FunctionRunResult } from "../generated/api";

export function run(input: RunInput): FunctionRunResult {
  const country = input.cart.buyerIdentity?.countryCode;

  // Hide "Cash on Delivery" for non-domestic orders
  const hideOperations = input.paymentMethods
    .filter((pm) => pm.name.toLowerCase().includes("cash on delivery") && country !== "US")
    .map((pm) => ({
      hide: { paymentMethodId: pm.id },
    }));

  return { operations: hideOperations };
}

Best Practices

  • Use the purchase.checkout.block.render target for maximum placement flexibility — merchants can drag the block anywhere in the checkout editor
  • Keep Function execution under 5ms — Shopify enforces a strict execution time limit; avoid network calls inside Functions (use metafields or Function input variables for configuration)
  • Use useSettings() hook to read merchant-configured values from the extension settings schema — avoids hardcoded IDs in extension code
  • Never read DOM or use browser APIs in UI extensions — they run in a sandboxed Worker environment without DOM access
  • Use @shopify/ui-extensions-react/checkout components only — native HTML and other UI libraries are not available in the extension sandbox
  • Test payment and shipping Functions with real checkout sessions — the local dev preview only works for UI extensions; Functions need to be deployed to test
  • Version-pin your extension API version — increment the api_version in shopify.extension.toml to access new APIs while keeping backward compatibility
  • Handle async operations with loading statesuseApplyCartLinesChange is async; show a spinner while the mutation is in flight

Common Pitfalls

ProblemSolution
Extension not appearing in checkout editorEnsure the extension is deployed (shopify app deploy) and the correct checkout template is selected in Admin → Checkout
Function returns FUNCTION_EXECUTION_TIMEOUTMove configuration out of runtime logic into Function input metafields; avoid complex loops on large catalogs
useCartLines returns stale data after cart updateUse the returned promise from applyCartLinesChange to wait for checkout to re-evaluate before reading cart lines again
Extension crashes with "Cannot use browser APIs"Remove document, window, localStorage references — the extension runs in a Worker sandbox
Discount Function not applyingVerify the Function-based discount is active in Admin → Discounts and the customer qualifies per any eligibility rules
Checkout UI extension settings not savingSettings fields require handle values that match the keys referenced by useSettings() in the extension code

Related Skills

  • @shopify-app-development
  • @shopify-storefront-api
  • @shopify-metafields
  • @checkout-flow-optimization
  • @shopify-admin-api

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

31.97%
按下载量换算50

Claude

30.5%
按下载量换算47

Cursor

18.75%
按下载量换算29

Gemini CLI

10.1%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

未通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills