Configuration
You can customise Snipcart’s settings using a PHP configuration file. This is optional: each setting has a default, so you only need to include the values you want to change.
To override a setting, create snipcart.php in your Craft project’s /config directory and return an array of setting names and values. For example, the following will set the default currency to US dollars:
<?php
return [
'defaultCurrency' => 'usd',
];All other settings keep their defaults. Add any further settings you want to change to the same array. The options below explain the available settings and their defaults. You can also manage many of these settings in the control panel under Settings → Snipcart.
Configuration Options
Snipcart API key.
- `secretApiKey - Snipcart secret API key.
The default currency.
Whether to send order notifications to designated store admins.
A collection of email addresses for admins who want order notifications.
Custom template to be used for admin order notification emails.
Whether to send completed order notifications to customers.
Custom template path for customer order notification emails.
Whether to decrement product quantities when orders are processed.
The name (not handle) of a custom field for Gift Notes, as sent to Snipcart.
The name (not handle) of a custom field for order comments, as sent to Snipcart.
Cache Snipcart API responses.
Snipcart API response cache duration.
Whether to log responses to shippingrates.fetch webhook events for troubleshooting.
The number of days to retain valid incoming webhook requests for troubleshooting before Craft garbage collection can delete them. Set this to 0 to retain them indefinitely.
Provider Settings
Return an array with the config settings for any shipping providers.
<?php
return [
'*' => [
// ...
'providerSettings' => [
'shipStation' => [
'apiKey' => '',
'apiSecret' => '',
'defaultCarrierCode' => '',
'defaultPackageCode' => '',
'defaultCountry' => 'US', // Required
'defaultWarehouseId' => 0, // Required
'defaultOrderConfirmation' => 'delivery', // Required
'enableShippingRates' => false,
'sendCompletedOrders' => false,
],
],
],
];Shipping Address
Return an array for the address to be used for rate quotes and orders with shipping providers.
<?php
return [
'*' => [
// ...
'shipFromAddress' => [
'name' => '',
'address1' => '',
'address2' => '',
'city' => '',
'state' => '',
'zip' => '',
'country' => '',
'phone' => '',
'email' => '',
],
],
];The public API key for the test account, selected when test mode is enabled.
The secret API key for live server-side requests. Keep it out of public templates.
The secret API key for test server-side requests.
The currency codes enabled for the store. The default enables US dollars.
Provider configuration for shipping integrations. Keep provider-specific options with the relevant shipping setup.
How many minutes an order remains eligible for re-feeding when the verification command finds it missing from ShipStation.
Whether to select the test API keys instead of the live keys.
Whether to send notification emails while testing.