
NextBlock Commerce: Multi-Currency, Tax Sync & Beyond
NextBlock Commerce: The Complete E-Commerce Toolkit
NextBlock Commerce is the first premium module in the NextBlock ecosystem — a source-available, license-gated package that transforms your CMS into a fully operational storefront. Here's everything it includes.
Product Catalog
Manage physical and digital products with full variant support. Each product supports attributes (like Size and Color), attribute terms, and variant combinations with independent pricing, SKUs, and stock levels. Product media is managed through the same media library used by the CMS, keeping assets organized.
Multi-Currency Engine
The multi-currency system is deep and production-ready:
- Unlimited currencies with ISO codes, symbols, and exchange rates
- Automatic FX sync from the Frankfurter API (or custom provider via
FX_API_BASE_URL) - Rounding modes: none, nearest, up, down, and charm pricing (e.g., $9.99)
- Store-managed auto-sync: product prices automatically convert when FX rates refresh
- Rebasing: when you change the default currency, all stored rates recalculate automatically
- Per-product overrides: set explicit prices in specific currencies or let auto-sync handle it
Tax Automation
Two tax modes are supported, controlled through the CMS settings:
Manual Mode
Define tax rates by country and optional state/province. Stacked taxes (GST + PST) are fully supported. Tax lines are calculated at checkout and stored in orders.tax_details.
Automatic Mode (Stripe Tax)
Defers tax calculation to Stripe Tax. Product and shipping tax codes are sent with line items, and the webhook resync replaces provisional data with finalized Stripe amounts.
Shipping Zones
A zone-based shipping resolver handles rate calculation:
- Define zones with country and state/province matching
- Multiple shipping methods per zone with localized names
- Per-currency pricing and free-shipping thresholds
- Automatic or manual currency pricing mode per method
- Priority-ordered fallback resolution when exact matches aren't found
Checkout Flow
The checkout is provider-aware:
- Stripe handles physical products — validates inventory, calculates shipping and tax, upserts customers, creates Checkout Sessions
- Freemius handles digital products — resolves licensing plans and pricing, builds checkout URLs with sandbox support
- Mixed-provider carts are rejected to maintain a clean checkout experience
Inventory Management
When quantity tracking is enabled, checkout validates requested quantities against inventory_items. On payment confirmation, apply_order_inventory_deduction() reduces stock with a resilient fallback path using direct SQL when the RPC fails.
Orders & Invoices
The full order lifecycle is managed through the CMS:
- Order statuses:
pending→paid→shipped(pluscancelledandrefunded) - Stable invoice numbering through database functions
- Printable invoice documents with business details from
invoice_settings - Customer order history and invoice access
- Coming soon: exportable order reports and analytics dashboards
CMS Commerce Surfaces
When the ecommerce package is active, the CMS shell exposes: product list/create/edit with media and variants, inventory management, orders list and detail views, shipping zones and rates, payment provider settings, tax configuration, and currency management.