adress PR feedback

This commit is contained in:
Dom Sip 2022-04-11 13:27:29 +01:00
parent ba873dfa1b
commit 4cfd71614b
4 changed files with 52 additions and 4 deletions

View File

@ -1 +1,7 @@
COMMERCE_PROVIDER=@vercel/commerce-sfcc
SFCC_CLIENT_ID=
SFCC_CLIENT_SECRET=
SFCC_ORG_ID=
SFCC_SHORT_CODE=
SFCC_SITE_ID=

View File

@ -1,7 +1,38 @@
# Next.js SalesForce Cloud Commerce Provider
## Installation
1. Copy the `.env.template` file in this directory (`/packages/sfcc`) to `/site/.env.local` in the main directory
2. `yarn` in root folder
3. `yarn dev` in root folder
refrences:
- https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic
- https://github.com/SalesforceCommerceCloud/commerce-sdk
## Features:
```json
{
"provider": "sfcc",
"features": {
"wishlist": false,
"cart": false,
"search": true,
"customerAuth": false,
"customCheckout": false
}
}
```
## Refrences:
- SDK: https://github.com/SalesforceCommerceCloud/commerce-sdk
- isomorphic SDK (currently not used atm): https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic
- PWA Kit storefront example: https://pwa-kit.mobify-storefront.com/
## Training Material and Documentation:
For a detailed introduction into commerce clouds feature set and data setup please refer to our Training Material and Documentation:
Salesforce Trailhead for B2C Commerce Cloud: https://trailhead.salesforce.com/en/content/learn/trails/cc-overview
Salesforce Trailhead for Development on B2C Commerce Cloud: https://trailhead.salesforce.com/en/content/learn/trails/develop-for-commerce-cloud
B2C Commerce Cloud Documentation:https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp
B2C Commerce Cloud Open Commerce API Doc: https://documentation.b2c.commercecloud.salesforce.com/DOC1/topic/com.demandware.dochelp/OCAPI/current/usage/OpenCommerceAPI.html?cp=0_15
Developer Center for Commerce Cloud (Commerce APIs specifically): https://developer.salesforce.com/docs/commerce/commerce-api/overview
SLAS Org Admin Setup Guide: https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=slas-admin:Summary

View File

@ -16,6 +16,11 @@ const getProducts: ProductsEndpoint['handlers']['getProducts'] = async ({
searchTerm = categoryId as string
}
// set default for main category
if (!searchTerm) {
searchTerm = 'clothing'
}
const searchClient = await sdk.getSearchClient();
// use SDK search API for initial products
const searchResults = await searchClient.productSearch({

View File

@ -48,3 +48,9 @@ KIBO_API_HOST=
NEXT_PUBLIC_COMMERCEJS_PUBLIC_KEY=
NEXT_PUBLIC_COMMERCEJS_DEPLOYMENT_URL=
SFCC_CLIENT_ID=
SFCC_CLIENT_SECRET=
SFCC_ORG_ID=
SFCC_SHORT_CODE=
SFCC_SITE_ID=