Add Commerce Layer Provider#517
Conversation
|
@BolajiAyodeji is attempting to deploy a commit to the Vercel Solutions Team on Vercel. A member of the Team first needs to authorize it. |
goncy
left a comment
There was a problem hiding this comment.
We can first focus on remove the code from the core and we can iterate over the rest later :)
| import { FC, useEffect, useState, useCallback } from 'react' | ||
| import { Logo, Button, Input } from '@components/ui' | ||
| import useLogin from '@framework/auth/use-login' | ||
| import useLogin from '@commerce/auth/use-login' |
There was a problem hiding this comment.
No code should be added outside the provider, if something is missing on the core we can discuss it in an external PR. Also @framework reffers to the hook from the provider, where you can extend the one from @commerce
There was a problem hiding this comment.
Okay, we'll submit a separate PR for the changes outside the provider, discuss the changes, and remove the changes from this PR.
|
Hey @BolajiAyodeji and @acasazza thanks for updating the provider! Can you please merge with main to resolve the conflicts? Thanks! |
Sure, I'll do that shortly. |
|
You can check now @goncy, thanks. |
| @@ -0,0 +1,36 @@ | |||
| import type { CheckoutEndpoint } from '.' | |||
| import getCredentials from '@framework/api/utils/getCredentials' | |||
There was a problem hiding this comment.
You shouldn't import from framework inside the provider, just relative, otherwise it may break other providers
There was a problem hiding this comment.
Change import from '@framework' to relative imports
I'm not sure what file that is. Where did you encounter that error, please? |
No |
Okay, I have fixed that. |
goncy
left a comment
There was a problem hiding this comment.
Some required files are missing, like checkout/use-checkout.tsx, customer/address/use-add-item and customer/use-add-item, you can get the empty files from other provider like bigcommerce.
| import { CommercelayerProvider } from './provider' | ||
| import { | ||
| CommerceConfig, | ||
| CommerceProvider as CoreCommerceProvider, |
There was a problem hiding this comment.
CommerceProvider doesn't exist in @commerce, you want to import CoreCommerceProvider directly. Also it doesn't receive a config prop as passed below
Alright, I'll fix that. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Hey there! Thank you for your contribution. We have decided to take Next.js Commerce in a new direction and will be closing out current PRs and issues due to this change. Please see this PR for more details: #966 Would love to see a Commerce LAyer version of v2! |

This PR adds Commerce Layer to the list of supported providers with the required hooks. This is a work in progress and is almost ready for production. Here's a brief summary of what we have currently and WIP features:
We used the local provider as the base, and we're working on completing the pending issues and features. There will be a lot of conflicts which we will fix since we forked this some months ago. So I'll be creating this PR in draft mode, do take a look and leave comments so we know if we're in the right direction; cheers!