Configuration
Configure Stub via config/stub.php or the control-panel settings.
Config File
<?php
return [
'defaultCurrency' => 'USD',
'defaultTimezone' => 'America/New_York',
'minimumNotice' => 60,
'maxAdvanceBooking' => 90,
'slotInterval' => 15,
'autoConfirmFreeBookings' => true,
'paymentEnabled' => false,
'stripePublishableKey' => '$STRIPE_PUBLISHABLE_KEY',
'stripeSecretKey' => '$STRIPE_SECRET_KEY',
'stripeWebhookSecret' => '$STRIPE_WEBHOOK_SECRET',
'adminEmail' => '[email protected]',
'primaryColor' => '#EC628C',
];
Key Settings
| Setting | Default | Description |
|---|---|---|
defaultCurrency | 'USD' | ISO 4217 code used for new services — see Currencies |
minimumNotice | 60 | Minimum booking notice in minutes |
maxAdvanceBooking | 90 | Maximum advance booking window in days |
slotInterval | 15 | Time slot interval in minutes |
paymentEnabled | false | Enable Stripe payment collection |
Currencies
Stub prices services in any of 25 common currencies: USD, EUR, GBP, CHF, CAD, AUD, NZD,
JPY, SEK, NOK, DKK, PLN, CZK, HUF, ZAR, SGD, HKD, INR, BRL, MXN, ILS, AED, TRY, KRW and THB.
defaultCurrency sets the site-wide default and each service can override it.
Prices are formatted with the currency’s own symbol, decimal count and symbol
placement — so JPY renders as ¥1,000 with no decimals, and a
euro-formatting locale gets 10,00 € rather than
€10.00.
With Craft Commerce
If Craft Commerce is installed, every currency configured on a Commerce store is offered automatically, on top of the built-in list. Commerce is not a dependency — nothing changes on a site without it.
A currency already saved on a service always stays in its picker, even if it is later removed from Commerce, so editing that service can never silently re-price it.
In templates
{# Format a price with its currency's symbol #}
{{ craft.stub.formatPrice(service.price, service.currency) }} {# CHF 10.00 #}
{# Every currency this site can price in, as code => label #}
{% for code, label in craft.stub.currencies() %}
{{ code }} — {{ label }}
{% endfor %}
Stripe and zero-decimal currencies
Stub converts each price to the smallest unit Stripe bills in, which is not always “cents”: JPY, KRW, VND and a dozen others have no minor unit, and BHD, JOD, KWD, OMR and TND are billed in thousandths rounded to the nearest ten. This is handled for you.
Which currencies your Stripe account can actually settle in depends on the country it is registered in. Stub will price a service in any valid code; if Stripe rejects the charge, that is an account limitation rather than a plugin one.