Merge branch 'main' into cart-a11y

This commit is contained in:
Luis Alvarez D 2021-07-29 16:07:25 -05:00 committed by GitHub
commit 3abea2124c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 10 deletions

View File

@ -22,7 +22,7 @@ export const handler: SWRHook<SearchProductsHook> = {
const url = new URL(options.url!, 'http://a')
if (search) url.searchParams.set('search', search)
if (Number.isInteger(categoryId))
if (Number.isInteger(Number(categoryId)))
url.searchParams.set('categoryId', String(categoryId))
if (Number.isInteger(brandId))
url.searchParams.set('brandId', String(brandId))

View File

@ -1,19 +1,22 @@
## Saleor Provider
**Demo:** TBD
**Demo:** https://saleor.vercel.store/
Before getting starter, a [Saleor](https://saleor.io/) account and store is required before using the provider.
You need a [Saleor](https://saleor.io/) instance, either in the cloud or self-hosted.
Next, copy the `.env.template` file in this directory to `.env.local` in the main directory (which will be ignored by Git):
This provider requires Saleor **3.x** or higher.
Copy the `.env.template` file in this directory to `.env.local` in the main directory (which will be ignored by Git):
```bash
cp framework/saleor/.env.template .env.local
```
Then, set the environment variables in `.env.local` to match the ones from your store.
Then, set the environment following variables in your `.env.local`. Both, `NEXT_PUBLIC_SALEOR_API_URL` and `COMMERCE_IMAGE_HOST` must point to your own Saleor instance.
## Contribute
Our commitment to Open Source can be found [here](https://vercel.com/oss).
If you find an issue with the provider or want a new feature, feel free to open a PR or [create a new issue](https://github.com/vercel/commerce/issues).
```
COMMERCE_PROVIDER=saleor
NEXT_PUBLIC_SALEOR_API_URL=https://vercel.saleor.cloud/graphql/
NEXT_PUBLIC_SALEOR_CHANNEL=default-channel
COMMERCE_IMAGE_HOST=vercel.saleor.cloud
```

View File

@ -13,6 +13,8 @@ UI hooks and data fetching methods built from the ground up for e-commerce appli
```
3. With the Vendure server running, start this project using `yarn dev` or `npm run dev`.
**Note:** The Vendure server needs to be configured to use the "cookie" tokenMethod rather than "bearer" to work with this provider. For more information see the [Managing Sessions docs](https://www.vendure.io/docs/storefront/managing-sessions/).
## Known Limitations
1. Vendure does not ship with built-in wishlist functionality.