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]',
'sendCustomerReminder' => false,
'sendInternalReminder' => false,
'reminderLeadTime' => 24,
'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 |
sendCustomerReminder | false | Email the customer before their appointment — see Reminders |
sendInternalReminder | false | Send the same reminder to the provider and the admin address |
reminderLeadTime | 24 | Hours before the appointment that reminders go out |
Reminders
Reminder emails are off by default, and that is deliberate: Craft has no scheduler, so nothing sends them until you add Stub’s console command to your server’s crontab. Switching them on without it would promise your customers an email that never arrives.
0 * * * * /path/to/craft stub/reminders/send
The settings screen prints this line with your own install path filled in. Hourly is plenty for a 24-hour lead time — the command only ever picks up bookings inside the window, so a tighter or looser schedule changes nothing about who gets reminded.
reminderLeadTime is in hours and accepts 1 to 336 (a fortnight). Full details of
what gets reminded, and how to send one by hand, are in
Usage.
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.