commerce
commerce copied to clipboard
Add Commerce Layer Provider
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:
- [x] API Endpoint - Checkout
- [x] API Operations - Get all pages
- [x] API Operations - Get all products path
- [x] API Operations - Get all products
- [x] API Operations - Get product
- [x] API Operations - Get customer wishlist
- [x] API Operations - Get page
- [x] API Operations - Get product
- [x] Feature - Cart
- [x] Feature - Search
- [x] Feature - Wishlist
- [x] Feature - Customer Auth
- [x] Feature - External Checkout
- [x] Feature - Categories
- [x] Feature - CMS integration
- [x] Provider documentation
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!
@BolajiAyodeji is attempting to deploy a commit to the Vercel Solutions Team on Vercel.
A member of the Team first needs to authorize it.
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.
commerce-local – ./site
🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-local/7vzbyThMtdpCM6QbBbReKgLAYqZb
✅ Preview: https://commerce-local-git-fork-bolaji-cd7116-vercel-solutions-vtest314.vercel.app
commerce-bigcommerce – ./
🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-bigcommerce/G2T6efCU1D5QeH1PiimeWpzvGsPS
✅ Preview: Failed
commerce-commercejs – ./
🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-commercejs/8sphdKo7nZsfViCwiR56TujcjQB8
✅ Preview: Failed
commerce-kibocommerce – ./
🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-kibocommerce/BQqPYY4a3CU9TcrBeNvZMvz6j91b
✅ Preview: Failed
commerce-ordercloud – ./
🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-ordercloud/Aec5LTEBr8uk24fKC36dx3SoNcqt
✅ Preview: Failed
commerce-saleor – ./
🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-saleor/8sdT1St9K6q7xBrtjA7kHojJy1dm
✅ Preview: Failed
commerce-shopify – ./
🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-shopify/9CAgDeYJDRHddB3aFHL4FMVEq9HF
✅ Preview: Failed
commerce-spree – ./
🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-spree/exGq2yxNxc2hSyYeMp4Q5tTpAnX9
✅ Preview: Failed
commerce-swell – ./
🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-swell/64RWPMnDwDunTohV3PDsrN3s8gyT
✅ Preview: Failed
commerce-vendure – ./
🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-vendure/VT2cityobLc1tseibNARaP8FsDU5
✅ Preview: Failed
Hey @BolajiAyodeji and @acasazza thanks for updating the provider! Can you please merge with main to resolve the conflicts? Thanks!
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.
Change import from '@framework' to relative imports
I'm not sure what file that is. Where did you encounter that error, please?
Change import from '@framework' to relative imports
I'm not sure what file that is. Where did you encounter that error, please?
No @framework imports should be present inside commercelayer folder.
Change import from '@framework' to relative imports
I'm not sure what file that is. Where did you encounter that error, please?
No
@frameworkimports should be present insidecommercelayerfolder.
Okay, I have fixed that.
Some required files are missing, like
checkout/use-checkout.tsx,customer/address/use-add-itemandcustomer/use-add-item, you can get the empty files from other provider like bigcommerce.
Alright, I'll fix that.
Hi @goncy, thanks for the comment, and a happy new year to you!
We'll make the required changes and get back to you; cheers.
Hi @goncy, everything works fine now and builds correctly. Do continue with the review; thank you.
The PR for the change on the core has been merged, please ensure no changes on the core has been made, including adding spaces so we can continue with the CR, thanks @acasazza @BolajiAyodeji!
Hi @goncy, you can proceed with the CR. Thank you.
Hi @goncy, I rebased our branch from the main. That should resolve all issues. Let me know. 🙌🏻
Oh, yes! I forgot that, sorry.
@BolajiAyodeji

When clicking an element on the cart it redirects to an undefined route
Please, ensure that all changes implemented on the provider works when people deploy their own version with their own store. No hardcoded values for the demo should be on providers code.
Hi @goncy,
Thanks for the review and feedback!
So Commerce Layer doesn't manage content. As a fully headless platform, we only handle transactional functionalities while content is managed independently by context experts on a content management system. This allows brands to utilize any content model, produce a better customer experience, outstand competition, and unleash creativity.
Since the provider doesn't support CMS's yet, we had to resort to using the local content method for now pending till when we can integrate our provider framework with available CMS. Our documentation will cover this and all new users have to do is either use the provider as a boilerplate and integrate their own CMS or rely on the local content method. Basically, the content comes from the local file but the line item comes from the API and both are connected via the SKU.
Do let us know how to proceed, please. Thanks.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| commerce-local | ❌ Failed (Inspect) | May 13, 2022 at 4:26PM (UTC) |
Hi @goncy and @okbel, this PR is ready for another review now. Basically we have added the content as an external resource as discussed and updated our package and documentation accordingly. Please take a look and let us know the next steps. Thank you and have a great weekend!
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: https://github.com/vercel/commerce/pull/966
Would love to see a Commerce LAyer version of v2!