From 0ebb922795b4af57da60c21d92826704c5d702eb Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Sat, 28 Aug 2021 00:11:01 -0500 Subject: [PATCH] Updated commerce readme --- README.md | 7 +------ framework/commerce/new-provider.md | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 759faea3a..2eeea375b 100644 --- a/README.md +++ b/README.md @@ -50,11 +50,6 @@ COMMERCE_PROVIDER=shopify NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=xxxxxxx.myshopify.com ``` -Add your provider to the list of supported providers in `framework/commerce/with-config.js`: - -``` -const PROVIDERS = ['bigcommerce', 'shopify', 'your-provider'] -``` And check that the `tsconfig.json` resolves to the chosen provider: @@ -84,7 +79,7 @@ For example: Turning `cart` off will disable Cart capabilities. > NOTE: The selected provider should support the feature that you are toggling. (This means that you can't turn wishlist on if the provider doesn't support this functionality out the box) -- Open `commerce.config.json` +- Open `commerce.config.json` - You'll see a config file like this: ```json { diff --git a/framework/commerce/new-provider.md b/framework/commerce/new-provider.md index 8c2feeab2..6e149a7d4 100644 --- a/framework/commerce/new-provider.md +++ b/framework/commerce/new-provider.md @@ -47,6 +47,12 @@ The app imports from the provider directly instead of the core commerce folder ( The provider folder should only depend on `framework/commerce` and dependencies in the main `package.json`. In the future we'll move the `framework` folder to a package that can be shared easily for multiple apps. +## Updating the list of known providers + +Open [./config.js](./config.js) and add the provider name to the list in `PROVIDERS`. + +Then, open [/.env.template](/.env.template) and add the provider name in the first line. + ## Adding the provider hooks Using BigCommerce as an example. The first thing to do is export a `CommerceProvider` component that includes a `provider` object with all the handlers that can be used for hooks: