Skip to content

Configuration ​

Schedules are set per shipping method in the control panel (Setting Up a Schedule). A few options that apply to every schedule go in a config file.

Create config/delivery-slots.php:

php
<?php

return [
    // How long a chosen slot is held for a customer who hasn’t paid yet, in minutes.
    'holdMinutes' => 15,

    // Slots with this many places or fewer count as nearly full (slot.isLow).
    'fewLeft' => 2,

    // An order field to show on the run sheet as the delivery note, such as a
    // “Delivery instructions” field in your order field layout.
    'noteField' => 'deliveryInstructions',

    // The order status the run sheet’s Mark delivered button sets.
    'deliveredStatus' => 'delivered',

    // Your own template and subject for the email customers get when staff change their slot.
    'slotChangedTemplate' => '_emails/slot-changed',
    'slotChangedSubject' => '{site}: your order {reference} now arrives {slot}',
];
OptionDefaultDescription
holdMinutes15How long a slot is held while the customer checks out. Raise it for slow payment gateways, or set it to 0 so only paid orders take places
fewLeft2When slot.isLow is true, for “2 left” notes
noteFieldnullThe handle of an order field shown as a Note column on the run sheet and in the CSV
deliveredStatusdeliveredThe handle of the order status that Mark delivered sets (run sheet)
slotChangedTemplatenullA site template for the email sent when staff change a slot. null uses the built-in email (Orders and Emails)
slotChangedSubjectnullThat email’s subject. {site}, {reference} and {slot} become the site name, order reference and new time. null: “{site}: your new delivery time for order {reference}”

Like any Craft config file, it can return different values per environment:

php
return [
    '*' => ['holdMinutes' => 15],
    'dev' => ['holdMinutes' => 60],
];

Time zone ​

Slot times and dates are in the site’s time zone, set in Settings → General. A store in Adelaide should use Australia/Adelaide, so “Order by 8pm” means 8pm in Adelaide.

A Craft Commerce plugin by Suprim