A lightweight Statamic Webby Commerce addon for managing products, orders, customers, coupons, taxes, shipping, cart, wishlist, and checkout.
- Collection-based WebbyCommerce data:
products,orders,customers,coupons,tax_rates,shipping_rates - Built-in storefront endpoints under
/shop - AJAX-friendly checkout with shipping, tax, coupon, and payment gateway support
- Configurable payment redirect/callback/webhook URLs
- Statamic Control Panel integration with a dedicated WebbyCommerce menu
- Statamic 5
- PHP version supported by Statamic 5
- Composer
- Node.js / npm for asset rebuilds (optional)
composer require webbycrown/webbycommerce-statamicAdd a path repository to your project composer.json:
"repositories": [
{
"type": "path",
"url": "addons/webbycrown/webbycommerce-statamic"
}
]Then install:
composer require webbycrown/webbycommerce-statamic:@devphp artisan vendor:publish --provider="WebbyCrown\WebbyCommerceStatamic\ServiceProvider"Optional tags:
php artisan vendor:publish --tag=webbycommerce-config
php artisan vendor:publish --tag=webbycommerce-views
php artisan vendor:publish --tag=webbycommerce-email-templates
php artisan vendor:publish --tag=webbycommerce-blueprintsLegacy webbycommerce-* publish tags are also supported for backwards compatibility.
php artisan optimize:clear
php please stache:clearAdd or update these variables in your .env:
WEBBYCOMMERCE_CURRENCY=USD
WEBBYCOMMERCE_PAYMENT_GATEWAY=stripe
WEBBYCOMMERCE_PAYMENT_REDIRECT_URL=https://example.com/shop/checkout/success/{orderNumber}
WEBBYCOMMERCE_PAYMENT_CALLBACK_URL=https://example.com/shop/payment/callback?order={orderNumber}
WEBBYCOMMERCE_PAYMENT_WEBHOOK_URL=https://example.com/shop/payment/webhook
STRIPE_SECRET_KEY=sk_test_...
STRIPE_PUBLISHABLE_KEY=pk_test_...Gateway-specific overrides are also supported:
STRIPE_REDIRECT_URL=https://example.com/shop/checkout/success/{orderNumber}
STRIPE_CALLBACK_URL=https://example.com/shop/payment/callback?order={orderNumber}
STRIPE_WEBHOOK_URL=https://example.com/shop/payment/webhookBase prefix: /shop
| Method | URI | Description |
|---|---|---|
| GET | /shop/products |
Product listing |
| GET | /shop/products/{slug} |
Product detail |
| GET | /shop/cart |
Cart page |
| POST | /shop/cart/add |
Add item |
| POST | /shop/cart/update |
Update item |
| POST | /shop/cart/remove/{key} |
Remove item |
| POST | /shop/checkout/process |
Synchronous checkout |
| POST | /shop/checkout/complete |
Complete checkout (AJAX) |
| GET | /shop/checkout/success/{orderNumber} |
Order success page |
| GET/POST | /shop/payment/callback |
Payment callback endpoint |
| POST | /shop/payment/webhook |
Payment webhook endpoint |
| GET | /shop/payment/redirect |
Payment redirect endpoint |
| GET | /shop/search |
Product search |
API endpoints:
| Method | URI | Description |
|---|---|---|
| GET | /shop/api/cart |
Get cart contents |
| GET | /shop/api/cart/count |
Cart count |
| POST | /shop/api/coupon/validate |
Validate coupon |
| POST | /shop/api/coupon/apply |
Apply coupon |
| GET | /shop/api/shipping/methods |
Shipping options |
| GET | /shop/api/wishlist |
Wishlist contents |
| GET | /shop/api/wishlist/count |
Wishlist count |
The addon provides the following Antlers tags under the webbycommerce namespace:
{{ webbycommerce:countries }}- list countries with optionalonly,exclude, andcommonparameters.{{ webbycommerce:regions country="US" }}- list regions for a country by ISO or name.{{ cart }}- returns the current cart as an array.{{ cart:has }}- returns whether the cart contains items.{{ cart:items }}- returns cart items.{{ cart:count }}- returns total cart item count.{{ cart:total_quantity }}- returns total quantity of items in the cart.{{ cart:subtotal }}- returns cart subtotal.{{ cart:total }}- returns cart total.{{ cart:tax }}- returns total tax.{{ cart:shipping }}- returns shipping cost.{{ cart:shipping_breakdown }}- returns shipping breakdown.{{ cart:discount }}- returns discount amount.{{ cart:tax_breakdown }}- returns tax breakdown.{{ cart:tax_rate }}- returns the applicable tax rate.{{ cart:is_tax_included }}- returns whether tax is included.{{ checkout:field key="email" default="" }}- retrieves checkout field values from old input or session.{{ checkout:payment key="method" default="" }}- retrieves checkout payment values from old input or session.{{ checkout:coupon_code }}- returns the current coupon code.{{ checkout:coupon_discount }}- returns the current coupon discount.{{ checkout:shipping_same_as_billing }}- returns whether shipping is same as billing.{{ checkout:countries }}- loads checkout country data.{{ checkout:states country="US" }}- loads checkout states for a given country.{{ product_tag }}- returns product collection results asresults.{{ wishlist:count }}- returns wishlist item count.{{ wishlist:items }}- returns wishlist items.{{ wishlist:has product_id="..." }}- returns whether a product is in the wishlist.
Example:
{{ cart }}
{{ total }}
{{ items }}
{{ title }}
{{ /items }}
{{ /cart }}Create starter entries for taxes and shipping rates:
php artisan webbycommerce:seed-defaultsUse --force to skip confirmation:
php artisan webbycommerce:seed-defaults --forceThe main configuration file is config/webbycommerce.php.
Key configuration areas:
currencyshippingproductsorderscustomerscouponscartpayment
The addon also supports store-level globals in content/globals/webbycommerce_settings.yaml:
store_name: My Store
store_email: admin@example.comstore_nameis mapped toconfig('webbycommerce.store.name')and is used in email templates.store_emailis mapped toconfig('webbycommerce.store.email')and is used as the fallback contact address in email notifications.
Order confirmation emails are controlled by both the global settings and the package config.
Update content/globals/webbycommerce_settings.yaml or the Statamic Control Panel global set:
email_order_confirmation_enabled: true
email_order_confirmation_to_customer: true
email_order_confirmation_to_admin: true
email_order_confirmation_admin_email: admin@example.comIf
email_order_confirmation_admin_emailis blank, the addon falls back tostore_email.
The addon maps the globals into config/webbycommerce.php under:
'emails' => [
'order_confirmation' => [
'enabled' => true,
'to_customer' => true,
'to_admin' => false,
'admin_email' => env('WEBBYCOMMERCE_ADMIN_EMAIL'),
],
'order_shipped' => [
'enabled' => true,
],
],enabledturns confirmation emails on or off.to_customersends the email to the customer.to_adminsends the email to the admin email address.admin_emailis the admin recipient address.
After changing settings, run:
php artisan optimize:clear| File | Purpose |
|---|---|
src/ServiceProvider.php |
Register routes, collections, permissions, and commands |
routes/shop.php |
Storefront route definitions |
config/webbycommerce.php |
Package configuration |
resources/blueprints/collections |
Statamic blueprints |
src/Cart/Cart.php |
Cart service |
src/Wishlist/Wishlist.php |
Wishlist service |
src/Http/Controllers/Shop/CheckoutController.php |
Checkout and payment logic |