Snipcart for Statamic
  • Overview
  • Getting Started
    • Installation
    • Configuration
    • Commands
  • Templating
    • Basics
    • Tags
      • Snipcart
      • Currency
      • Length
      • Weight
    • Modifiers
  • Customization
    • Blueprints
    • Translations
  • Advanced
    • Snipcart API
    • Snipcart Webhooks
Powered by GitBook
On this page
  • Install Addon
  • Perform Basic Configuration
  • Run Setup Command
  • Add Snipcart API Keys
  • Add Script Tag
  • Add Webhook URL

Was this helpful?

  1. Getting Started

Installation

Follow the instructions below to setup Snipcart for Statamic.

PreviousOverviewNextConfiguration

Last updated 2 years ago

Was this helpful?

Install Addon

Install the addon with Composer:

composer require aerni/snipcart

Perform Basic Configuration

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: Add the collections and taxonomies you want to use for your products.

Run Setup Command

After configuring your Sites and Collections & Taxonomies, you may run the setup command. This will create all the necessary collections, taxonomies, and blueprints to get you started.

php please snipcart:setup

After running the command, make sure to customize the configuration of the created collections and taxonomies to define the sites, templates, routes, etc.

Add Snipcart API Keys

Add your Snipcart API keys to your .env file. You can find them in your .

SNIPCART_LIVE_KEY=************************
SNIPCART_LIVE_SECRET=************************

SNIPCART_TEST_KEY=************************
SNIPCART_TEST_SECRET=************************

Add Script Tag

Add the following tag to your layout view. Snipcart recommends adding it directly after the <body> element.

{{ snipcart:script }}

Add Webhook URL

Add the absolute URL of the configured Snipcart webhook to your , eg. https://my-shop.com/webhooks/snipcart

You can in the config. The default route is webhooks/snipcart.

Learn more
Learn more
Snipcart dashboard
Snipcart Dashboard
customize the webhook route