magento-checkout

Customize Magento 2 checkout — payment methods, shipping carriers, totals collectors, and checkout UI. Use when building custom payment/shipping integrations or modifying the checkout flow.

17 stars

Best use case

magento-checkout is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Customize Magento 2 checkout — payment methods, shipping carriers, totals collectors, and checkout UI. Use when building custom payment/shipping integrations or modifying the checkout flow.

Teams using magento-checkout should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/magento-checkout/SKILL.md --create-dirs "https://raw.githubusercontent.com/OrcaQubits/agentic-commerce-skills-plugins/main/dist/antigravity/magento2-commerce/.agent/skills/magento-checkout/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/magento-checkout/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How magento-checkout Compares

Feature / Agentmagento-checkoutStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Customize Magento 2 checkout — payment methods, shipping carriers, totals collectors, and checkout UI. Use when building custom payment/shipping integrations or modifying the checkout flow.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Magento 2 Checkout Customization

## Before writing code

**Fetch live docs**:
1. Web-search `site:developer.adobe.com commerce php tutorials frontend custom-checkout` for checkout customization tutorials
2. Web-search `site:developer.adobe.com commerce php tutorials frontend custom-checkout add-payment-method` for payment method tutorial
3. Web-search `site:developer.adobe.com commerce php development components checkout` for checkout architecture

## Conceptual Architecture

### Checkout Flow

Two-step checkout built with UI Components + KnockoutJS:
1. **Shipping Step** — address, shipping method selection
2. **Payment & Review Step** — payment method selection, order review, place order

### Quote Model

The central data structure during checkout:
- `Magento\Quote\Model\Quote` — the cart/checkout session
- Contains items, addresses (billing + shipping), payment, totals
- Converted to an Order on successful placement

## Payment Methods

### Three Categories

| Type | Description |
|------|-------------|
| **Gateway** | Data passes through Magento to processor (Stripe, Braintree) |
| **Offline** | No external provider (Check/Money Order, Bank Transfer, COD) |
| **Hosted** | Redirects to external payment page (PayPal Redirect) |

### Implementation Components

1. **Payment Model** — uses Payment Gateway Command pattern with `Magento\Payment\Model\Method\Adapter` as a virtual type (recommended). Note: `Magento\Payment\Model\Method\AbstractMethod` is deprecated; avoid for new payment methods.
2. **Config Provider** — implements `ConfigProviderInterface`, returns JS config for checkout
3. **JS Renderer** — KnockoutJS component rendering the payment form in checkout
4. **di.xml** — register config provider into composite config provider
5. **system.xml/config.xml** — admin configuration fields for enabling/configuring the method

### Payment Gateway Command Pattern

Modern approach (since 2.1) with configurable command chain:
- Command objects for each operation (authorize, capture, refund, void)
- Request builders construct gateway-specific payloads
- Response handlers process gateway responses
- Validators verify responses
- Transfer factory creates HTTP transfer objects

## Shipping Methods

### Carrier Implementation

Shipping carriers extend `Magento\Shipping\Model\Carrier\AbstractCarrier`:
- `collectRates()` — returns available shipping rates for the cart
- `getAllowedMethods()` — returns method code/name pairs
- Configuration in `config.xml` (defaults) and `system.xml` (admin fields)
- Tracking capability via `getTrackingInfo()`

## Totals Collectors

### What Totals Collectors Do

Calculate order totals (subtotal, shipping, tax, discount, grand total):
- Declared in `etc/sales.xml`
- Extend `Magento\Quote\Model\Quote\Address\Total\AbstractTotal`
- `collect()` — performs calculation, modifies quote address totals
- `fetch()` — returns the result for display

### Collector Order

Collectors run in sequence. Standard order: subtotal → discount → shipping → tax → grand_total. Custom collectors must declare their position relative to existing ones.

## Checkout UI Customization

### Layout Modification

Checkout layout is defined in `checkout_index_index.xml`. Modify via:
- Adding new UI components to checkout steps
- Moving/removing existing components
- Plugin on `LayoutProcessorInterface` for dynamic modifications

### Custom Checkout Steps

Add entire new steps via JavaScript UI components registered in the checkout layout.

## Best Practices

- Use the Payment Gateway Command pattern for new payment methods
- Test payment methods in sandbox/test mode before production
- Handle payment failures gracefully with clear customer messaging
- Use config providers to pass server config to checkout JS
- Follow PCI compliance — never log or store raw card data
- Test shipping rate calculation with various cart compositions

Fetch the checkout customization tutorials for exact class signatures, XML configurations, and JS component patterns before implementing.

Related Skills

woo-checkout

17
from OrcaQubits/agentic-commerce-skills-plugins

Customize WooCommerce checkout — classic and block-based checkout, custom fields, validation, order processing, and checkout extensibility. Use when modifying the checkout flow, adding custom checkout fields, or integrating checkout extensions.

ucp-embedded-checkout

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement UCP Embedded Checkout Protocol — iframe/webview-based checkout UI for human escalation using JSON-RPC 2.0 over postMessage. Use when the checkout status is requires_escalation and the buyer needs a merchant-hosted UI.

ucp-checkout-rest

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement UCP Checkout over the REST binding — create, get, update, complete, and cancel checkout sessions with proper headers, idempotency, status transitions, and error handling. Use when building REST-based UCP checkout endpoints or clients.

ucp-checkout-mcp

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement UCP Checkout over the MCP (Model Context Protocol) binding — expose checkout operations as MCP tools for AI agents. Use when building an MCP server that AI agents like Claude or Gemini can call for commerce, or when integrating with Shopify's MCP endpoint.

ucp-checkout-a2a

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement UCP Checkout over the A2A (Agent-to-Agent) binding — enable autonomous agent-to-agent commerce using Agent Cards and structured message parts. Use when building agent-to-agent commerce flows.

spree-checkout

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement Spree's checkout — the Order state machine (cart → address → delivery → payment → confirm → complete), the Payment and Shipment sub-state machines, the return flow (ReturnAuthorization → CustomerReturn → Reimbursement → Refund), guest checkout, payment-step skipping for credit-covered orders, and the V3 checkout API surface. Use when building or customizing checkout flows, debugging state transitions, or wiring custom checkout steps.

shopify-checkout-ui

17
from OrcaQubits/agentic-commerce-skills-plugins

Build Shopify checkout UI extensions — extension targets, UI primitives, Preact/Remote DOM rendering, checkout APIs, metafield access, post-purchase extensions, and thank-you page customization. Use when customizing Shopify checkout.

saleor-checkout

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement the Saleor checkout flow — checkout creation, line items, shipping/billing addresses, delivery methods, payment, and completion. Use when building checkout experiences.

medusa-cart-checkout

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement Medusa v2 cart and checkout — cart lifecycle, line items, shipping and payment selection, sales channels, and checkout completion flow. Use when building cart and checkout features.

magento-testing

17
from OrcaQubits/agentic-commerce-skills-plugins

Write tests for Magento 2 — PHPUnit unit tests, integration tests, MFTF functional tests, and API tests. Use when implementing test coverage for modules, debugging, or setting up CI/CD test pipelines.

magento-setup

17
from OrcaQubits/agentic-commerce-skills-plugins

Set up a Magento 2 Open Source project — installation, Composer setup, system requirements verification, and initial configuration. Use when starting a new Magento project or setting up a development environment.

magento-service-contracts

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement Magento 2 service contracts — repository interfaces, data interfaces, SearchCriteria, and the repository pattern. Use when building module APIs, data access layers, or integrating with Magento's Web API.