You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/en/CMS/customers.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ If you want Shopify and Statamic to sync users and customers you need to change
8
8
9
9
## Link Statamic customers from Shopify
10
10
11
-
To create a link between Shopify customers and Statamic users you need to ensure your Shopify app has `customer read` and `customer write` permissions.
11
+
To create a link between Shopify customers and Statamic users you need to ensure your Private Shopify app has `customer read` and `customer write` permissions.
|`SHOPIFY_APP_URL`| The url to your store (no https://) |
12
+
|`SHOPIFY_ADMIN_TOKEN`| The Admin API access token you received when generating your app |
13
+
|`SHOPIFY_AUTH_KEY`| The Admin API key found when creating your private app. This is optional and only required if you want to use the REST API.|
14
+
|`SHOPIFY_AUTH_PASSWORD`| The Admin API password found when creating your private app. This is optional and only required if you want to use the REST API. |
15
15
16
16
## Required For Frontend
17
17
18
18
If you are using the JavaScript publishable in the addon you'll need to set the following.
19
19
20
-
| Value | Description |
21
-
| -------------------|-------------|
22
-
|`SHOPIFY_APP_URL`| The url to your myshopify.com store (no https://) |
23
-
|`SHOPIFY_STOREFRONT_URL`| The custom url to your store if you have one (no https://) |
24
-
|`SHOPIFY_STOREFRONT_TOKEN`| Found when enabling the Storefront API whilst creating your private app |
If you are on a Windows environment, please set the `SHOPIFY_SESSION_STORAGE_PATH` .env value to a writeable path.
26
26
27
-
## Creating a Shopify App
28
27
29
-
To set up a private app on Shopify for this add-on to use, use the following steps:
28
+
### Step 1: Using Shopify's Headless app for front end Storefront integration
29
+
30
+
In you are using the front end code to access the Storefront API we recommend you set up [Shopify's Headless](https://apps.shopify.com/headless) on your store. This app lets you create a new sales channel that you can use to determine which of your products are available on your Statamic site.
31
+
32
+
Once you have installed the app you should create a new sales channel, with a meaningful name (eg "Statamic").
33
+
34
+
In the Sales Channel Credentials screen you should now be able to copy your keys as follows:
35
+
36
+
```bash
37
+
SHOPIFY_APP_URL="your-store.myshopify.com"
38
+
SHOPIFY_STOREFRONT_TOKEN="{Public access token}"
39
+
SHOPIFY_SALES_CHANNEL="{Sales channel name}"
40
+
```
41
+
42
+
43
+
### Step 2: Create a private app for Admin API integration
44
+
Set up a private app on Shopify for this add-on using the following steps:
30
45
31
46
1. Visit the "Apps" section in your Shopify admin by clicking on the sidebar menu link, then in the modal that appears "App and sales channel settings".
32
47
2. Click "Develop Apps" in the top right.
33
48
3. Click "Create an app" in the top right to make a new one.
34
-
4. Set a nice name to remember as well as your email.
49
+
4. Set a nice name to remember (eg "Statamic Admin") as well as your email.
35
50
5. Click the "Configuration" Tab.
36
51
1. Click "Configure" next to Admin API Integration.
6. Click the "API Credentials" tab. Add the `Admin API access token` to your `.env` as `SHOPIFY_ADMIN_TOKEN`, add `API key` as `SHOPIFY_AUTH_KEY`, add `API secret key` as `SHOPIFY_AUTH_PASSWORD`, and add `Storefront API access token` as `SHOPIFY_STOREFRONT_TOKEN`.
54
+
6. Click the "API Credentials" tab. Add the `Admin API access token` to your `.env` as `SHOPIFY_ADMIN_TOKEN`.
42
55
7. If you've configured the app properly you should see a button that says "Install App". Click this.
43
56
57
+
### 3. Shopfront redirection
58
+
If you are not intending to use the Shopify storefront you should perform redirection from any Shopify URLs to your website.
59
+
60
+
We recommend installing Shopify's [Hydrogen Redirect Theme](https://github.com/Shopify/hydrogen-redirect-theme), and following their setup instructions.
44
61
45
-
## Environment Variables
62
+
### 4. Finalise your .env
63
+
After completing steps 1 and 2 your .env should look as follows:
64
+
65
+
```bash
66
+
SHOPIFY_APP_URL="your-store.myshopify.com"
67
+
SHOPIFY_STOREFRONT_TOKEN="{Public access token}"
68
+
SHOPIFY_SALES_CHANNEL="{Sales channel name}"
69
+
SHOPIFY_ADMIN_TOKEN="{Admin API access token}"
70
+
```
46
71
47
-
Ensure you've set the necessary environment variables as defined in the ["Env Values"](/env) section.
72
+
You may also wish to add some of the option values defined in the ["Env Values"](/env) section.
0 commit comments