Installation
Follow the instructions below to setup Snipcart for Statamic.
Option 1: Install the addon with Composer.
composer require aerni/snipcart
Option 2: Install the addon through the Addons section in the Statamic Control Panel.
The installation process will automatically publish the addon's config to
config/snipcart.php
. Open the config and perform the following configuration:- 1.Sites: Add the desired currency, length, and weight units for each of your sites
- 2.Collections & Taxonomies: Define the handles for your products collection and categories taxonomy
After configuring your Sites and Collection & Taxonomies you need to run the
setup
command. This command will create all the necessary collections, taxonomies, and blueprints to get you started.php please snipcart:setup
SNIPCART_LIVE_KEY=************************
SNIPCART_LIVE_SECRET=************************
SNIPCART_TEST_KEY=************************
SNIPCART_TEST_SECRET=************************
Add the absolute URL of your Snipcart Webhook to your Snipcart Dashboard, eg.
https://my-shop.com/webhooks/snipcart
Add this tag to the
<head>
in your view to render Snipcart's preconnect hints
and stylesheet
.{{ snipcart:head }}
If you want more control, you may add the
preconnect hints
and stylesheet
separately instead.{{ snipcart:preconnect }}
{{ snipcart:stylesheet }}
Add this tag before the closing
</body>
in your view to render Snipcart's container
and script
.{{ snipcart:body }}
If you want more control, you may add the
container
and script
separately instead. Just make sure to include the script after the container.{{ snipcart:container }}
{{ snipcart:script }}
Last modified 2yr ago