Add settings and readiness checks to the Control Panel
Register an extension settings page or an authorized link beside the matching store settings.
Browse guides
On this page
Register a settings link#
In the extension's service provider, resolve Sellissimo\Core\SettingsRegistry during boot. Use action to link an established editor from a section. The route is a Statamic CP route name. Set the shared argument to true for a storewide editor and enforce storewide authorization on its own routes as well.
app(\Sellissimo\Core\SettingsRegistry::class)->action(
'shipping', 'Pickup locations', 'my-pickup.locations', 'manage sellissimo shipping', true
);
Add an editable settings section#
Use section to provide a native settings form. Give each section a unique handle and each field a unique handle within its section. Provide the field definition, inherited default, Laravel validation rules and any shared scope. The optional validation callback receives the site and submitted changes inside the store transaction. A reset is represented by a null value. A readiness callback can return a list of messages with optional authorized URLs. The merchant sees these tasks in the overview.
use Sellissimo\Core\SettingsRegistry;
use Sellissimo\Core\StoreSettings;
app(SettingsRegistry::class)->section(
'pickup-desk', 'Pickup desk', 'Instructions shown when an order is collected.',
'manage sellissimo shipping',
fn (string $site) => [
'my_pickup_instructions' => [
'field' => ['type' => 'textarea', 'display' => 'Collection instructions'],
'default' => '', 'rules' => 'nullable|string|max:500',
],
],
);
// Read the same effective setting inside your pickup checkout step.
$instructions = StoreSettings::forSection($site, 'pickup-desk', 'my_pickup_instructions', '');
Core checks section permission, site access, shared scope, hosting locks and revisions before a save. Use provider-specific encrypted storage for credentials. Ordinary setting fields are available to the browser and are intended for merchant preferences.