You're viewing the documentation of an older Simple Commerce version. Consider upgrading to the latest for new features and bug fixes.

During addon installation, a config/simple-commerce.php is published in your project. This is the file where your Simple Commerce configuration lives.

Site configuration

Statamic has a concept of sites. Each Statamic instance can have one or more sites. For each of those sites you can use a different currency, a different tax configuration and different shipping methods.

1/*
2|--------------------------------------------------------------------------
3| Sites
4|--------------------------------------------------------------------------
5|
6| For each of your Statamic sites, you can setup a new store which allows you
7| to use different currencies, tax rates and shipping methods.
8|
9*/
10 
11'sites' => [
12 'default' => [
13 'currency' => 'GBP',
14 
15 'tax' => [
16 'rate' => 20,
17 'included_in_prices' => false,
18 ],
19 
20 'shipping' => [
21 'methods' => [
22 \DoubleThreeDigital\SimpleCommerce\Shipping\StandardPost::class,
23 ],
24 ],
25 ],
26],

Whenever you want to add another site to Simple Commerce, just change the array key from default to your new one. Remember to keep the site key the same between the Simple Commerce config and the Statamic config.

1'sites' => [
2 'default' => [...],
3 'french' => [...],
4],

Hot Tip: Also remember that if you're wanting to use multiple sites, you'll need to purchase & enable Statamic Pro.

Let's walk through some of the configuration options you have with each site.

  • The first option is currency, you can use a variety of different currencies in Simple Commerce. To configure one, just put in the three letter currency code and it should be picked up.

  • Tax is another thing you can configure. The default configuration has the tax rate setup at 20% and that the product prices include tax. You can obviusly change this to whatever you'd like.

  • Each site can have its own set of shipping methods. A lot of sites have custom shipping rules, so we recommend you build one specifically for your site.

Gateways

Simple Commerce has quite a few built-in payment gateways, as always its something you build custom for your store.

1/*
2|--------------------------------------------------------------------------
3| Gateways
4|--------------------------------------------------------------------------
5|
6| You can setup multiple payment gateways for your store with Simple Commerce.
7| Here's where you can configure the gateways in use.
8|
9*/
10 
11'gateways' => [
12 \DoubleThreeDigital\SimpleCommerce\Gateways\DummyGateway::class => [],
13],

To add a gateway, just add the gateway's class name (DummyGateway::class syntax) as the array key and an array as the value. The value is normally used for any gateway configuration. If your gateway doesn't have any configuration options, just leave it as an empty array.

Notifications

1/*
2|--------------------------------------------------------------------------
3| Notifications
4|--------------------------------------------------------------------------
5|
6| Simple Commerce can automatically send notifications to customers after
7| events occur in your store. eg. a cart being completed.
8|
9| Here's where you can toggle if certain notifications are enabled/disabled.
10|
11*/
12 
13'notifications' => [
14 'cart_confirmation' => true,
15],

Simple Commerce can be configured to automatically send emails to your customers when certain events happen. For example, an order confirmation email when an order has been completed.

We've written a bit more about Notification configuration over here.

Collections & Taxonomies

1/*
2|--------------------------------------------------------------------------
3| Collections & Taxonomies
4|--------------------------------------------------------------------------
5|
6| Simple Commerce uses Statamic's native collections and taxonomies functionality.
7| It will automatically create collections/taxonomies upon addon installation if
8| they don't already exist. However, if you'd like to use a different collection
9| or taxonomy, like one you've already setup, here's the place to change that.
10|
11*/
12 
13'collections' => [
14 'products' => 'products',
15 'orders' => 'orders',
16 'coupons' => 'coupons',
17],
18 
19'taxonomies' => [
20 'product_categories' => 'product_categories',
21 'order_statuses' => 'order_statuses',
22],

If you'd like to change the collections and handles used for certain things in Simple Commerce, we allow you to do that. Just change the appropriate value to the handle of the collection you'd like to use instead.

For example, to use a collection called Discounts, with a handle of discounts for your orders, you could configure that like this:

1'collections' => [
2 ...,
3 'coupons' => 'discounts',
4],

Various other options

There's a few smaller configuration options too. We've documented them in some bullet points below.

  • cart_key will determine the session key used for a customers' cart.
Last updated 3 months ago Improve this page on GitHub!