Single source of truth for Birkly CMS documentation

The Shopping Cart plugin (plugins/shopping_cart/) is a payment_shelf consumer: products live in the shop_products collection, checkout creates orders and charges via Payments, and order status updates when payment webhooks fire.

Prerequisites

  1. Payments plugin active with at least one provider connection.
  2. Shopping Cart plugin activated (seeds shop_products collection on first activation).
  3. Cart plugin granted access_payment_shelf (auto-granted on activation).

Admin

Open Shop in the admin sidebar.

TabPurpose
OrdersList orders, status, payment IDs, cancel pending orders
SettingsCheckout success/cancel paths

Use Manage Products to edit the shop_products collection (title, price, currency, SKU, stock).

Checkout flow

  1. Visitor adds items via API (action=add) or template URLs.
  2. Checkout creates a pending order and calls payment_shelf->createPayment() with source_plugin=shopping_cart and source_ref=order_id.
  3. Provider webhook → Payments broadcasts payment_succeeded → Cart marks order paid and clears the session cart.

Public API

Base: /api/index.php?route=shopping_cart

ActionAuthDescription
getPublicCart contents and total
addPublicAdd product (product_id, quantity)
updatePublicSet quantity
removePublicRemove line
checkoutPublicStart payment (customer_email, optional return URLs)
list_ordersAdminAll orders
get_orderAdminSingle order
cancel_orderAdminCancel pending order (CSRF)

Template functions

FunctionReturns
{cart_count}Item count in session
{cart_checkout_url}Checkout API URL
{cart_add_url product_id}Add-to-cart URL

Automation triggers

  • order_created — pending order created from cart
  • order_paid — order marked paid after webhook
  • order_cancelled — admin cancelled order