mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
Merge branch 'main' of github.com:vercel/commerce into outgrow-reaction-commerce-provider
This commit is contained in:
commit
f5cdc66a68
@ -20,3 +20,6 @@ NEXT_PUBLIC_SWELL_PUBLIC_KEY=
|
|||||||
|
|
||||||
NEXT_PUBLIC_SALEOR_API_URL=
|
NEXT_PUBLIC_SALEOR_API_URL=
|
||||||
NEXT_PUBLIC_SALEOR_CHANNEL=
|
NEXT_PUBLIC_SALEOR_CHANNEL=
|
||||||
|
|
||||||
|
NEXT_PUBLIC_VENDURE_SHOP_API_URL=
|
||||||
|
NEXT_PUBLIC_VENDURE_LOCAL_URL=
|
||||||
|
@ -151,5 +151,5 @@ Next, you're free to customize the starter. More updates coming soon. Stay tuned
|
|||||||
After Email confirmation, Checkout should be manually enabled through BigCommerce platform. Look for "Review & test your store" section through BigCommerce's dashboard.
|
After Email confirmation, Checkout should be manually enabled through BigCommerce platform. Look for "Review & test your store" section through BigCommerce's dashboard.
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
BigCommerce team has been notified and they plan to add more detailed about this subject.
|
BigCommerce team has been notified and they plan to add more details about this subject.
|
||||||
</details>
|
</details>
|
||||||
|
@ -77,7 +77,6 @@ html {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
touch-action: manipulation;
|
touch-action: manipulation;
|
||||||
font-feature-settings: 'case' 1, 'rlig' 1, 'calt' 0;
|
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
@ -38,6 +38,7 @@ const LoginView: FC<Props> = () => {
|
|||||||
} catch ({ errors }) {
|
} catch ({ errors }) {
|
||||||
setMessage(errors[0].message)
|
setMessage(errors[0].message)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
setDisabled(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import Image, { ImageProps } from 'next/image'
|
|||||||
import WishlistButton from '@components/wishlist/WishlistButton'
|
import WishlistButton from '@components/wishlist/WishlistButton'
|
||||||
import usePrice from '@framework/product/use-price'
|
import usePrice from '@framework/product/use-price'
|
||||||
import ProductTag from '../ProductTag'
|
import ProductTag from '../ProductTag'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
className?: string
|
className?: string
|
||||||
product: Product
|
product: Product
|
||||||
@ -23,7 +24,6 @@ const ProductCard: FC<Props> = ({
|
|||||||
className,
|
className,
|
||||||
noNameTag = false,
|
noNameTag = false,
|
||||||
variant = 'default',
|
variant = 'default',
|
||||||
...props
|
|
||||||
}) => {
|
}) => {
|
||||||
const { price } = usePrice({
|
const { price } = usePrice({
|
||||||
amount: product.price.value,
|
amount: product.price.value,
|
||||||
@ -38,7 +38,7 @@ const ProductCard: FC<Props> = ({
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href={`/product/${product.slug}`} {...props}>
|
<Link href={`/product/${product.slug}`}>
|
||||||
<a className={rootClassName}>
|
<a className={rootClassName}>
|
||||||
{variant === 'slim' && (
|
{variant === 'slim' && (
|
||||||
<>
|
<>
|
||||||
|
@ -16,7 +16,7 @@ export const handler: MutationHook<LoginHook> = {
|
|||||||
if (!(email && password)) {
|
if (!(email && password)) {
|
||||||
throw new CommerceError({
|
throw new CommerceError({
|
||||||
message:
|
message:
|
||||||
'A first name, last name, email and password are required to login',
|
'An email and password are required to login',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ export const handler: SWRHook<SearchProductsHook> = {
|
|||||||
const url = new URL(options.url!, 'http://a')
|
const url = new URL(options.url!, 'http://a')
|
||||||
|
|
||||||
if (search) url.searchParams.set('search', search)
|
if (search) url.searchParams.set('search', search)
|
||||||
if (Number.isInteger(categoryId))
|
if (Number.isInteger(Number(categoryId)))
|
||||||
url.searchParams.set('categoryId', String(categoryId))
|
url.searchParams.set('categoryId', String(categoryId))
|
||||||
if (Number.isInteger(brandId))
|
if (Number.isInteger(brandId))
|
||||||
url.searchParams.set('brandId', String(brandId))
|
url.searchParams.set('brandId', String(brandId))
|
||||||
|
@ -1,19 +1,22 @@
|
|||||||
## Saleor Provider
|
## 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
|
```bash
|
||||||
cp framework/saleor/.env.template .env.local
|
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
|
```
|
||||||
|
COMMERCE_PROVIDER=saleor
|
||||||
Our commitment to Open Source can be found [here](https://vercel.com/oss).
|
NEXT_PUBLIC_SALEOR_API_URL=https://vercel.saleor.cloud/graphql/
|
||||||
|
NEXT_PUBLIC_SALEOR_CHANNEL=default-channel
|
||||||
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_IMAGE_HOST=vercel.saleor.cloud
|
||||||
|
```
|
||||||
|
@ -22,7 +22,7 @@ export const handler: MutationHook<LoginHook> = {
|
|||||||
if (!(email && password)) {
|
if (!(email && password)) {
|
||||||
throw new CommerceError({
|
throw new CommerceError({
|
||||||
message:
|
message:
|
||||||
'A first name, last name, email and password are required to login',
|
'An email and password are required to login',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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`.
|
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
|
## Known Limitations
|
||||||
|
|
||||||
1. Vendure does not ship with built-in wishlist functionality.
|
1. Vendure does not ship with built-in wishlist functionality.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user