commerce icon indicating copy to clipboard operation
commerce copied to clipboard

Add Commerce Layer Provider

Open BolajiAyodeji opened this issue 4 years ago • 18 comments

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 avatar Oct 01 '21 20:10 BolajiAyodeji

@BolajiAyodeji is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 01 '21 20:10 vercel[bot]

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

vercel[bot] avatar Oct 01 '21 20:10 vercel[bot]

Hey @BolajiAyodeji and @acasazza thanks for updating the provider! Can you please merge with main to resolve the conflicts? Thanks!

goncy avatar Dec 20 '21 15:12 goncy

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.

BolajiAyodeji avatar Dec 20 '21 17:12 BolajiAyodeji

You can check now @goncy, thanks.

BolajiAyodeji avatar Dec 20 '21 21:12 BolajiAyodeji

Change import from '@framework' to relative imports

I'm not sure what file that is. Where did you encounter that error, please?

BolajiAyodeji avatar Dec 21 '21 18:12 BolajiAyodeji

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.

goncy avatar Dec 22 '21 13:12 goncy

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.

Okay, I have fixed that.

BolajiAyodeji avatar Dec 22 '21 14:12 BolajiAyodeji

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.

Alright, I'll fix that.

BolajiAyodeji avatar Dec 23 '21 17:12 BolajiAyodeji

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.

BolajiAyodeji avatar Jan 05 '22 01:01 BolajiAyodeji

Hi @goncy, everything works fine now and builds correctly. Do continue with the review; thank you.

BolajiAyodeji avatar Jan 05 '22 17:01 BolajiAyodeji

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.

BolajiAyodeji avatar Jan 18 '22 02:01 BolajiAyodeji

Hi @goncy, I rebased our branch from the main. That should resolve all issues. Let me know. 🙌🏻

acasazza avatar Jan 21 '22 10:01 acasazza

Oh, yes! I forgot that, sorry.

BolajiAyodeji avatar Jan 26 '22 14:01 BolajiAyodeji

@BolajiAyodeji image

When clicking an element on the cart it redirects to an undefined route

goncy avatar Feb 01 '22 12:02 goncy

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.

BolajiAyodeji avatar Feb 15 '22 06:02 BolajiAyodeji

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)

vercel[bot] avatar May 10 '22 16:05 vercel[bot]

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!

BolajiAyodeji avatar May 13 '22 16:05 BolajiAyodeji

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!

leerob avatar Apr 18 '23 02:04 leerob