Our Blog

AI Engine (ChatGPT) For Salesforce B2C Commerce

AI Engine (ChatGPT) For Salesforce B2C Commerce enables store admins to integrate ChatGPT AI into your Salesforce Commerce Cloud (SFCC) Business Manager. The admin can now generate the content for listing the products on their website. You can also edit the content using the HTML editor. You can regenerate the specific field content if you want to. The content can be generated for product descriptions and product details. Also, for its Search Engine Optimization support as well such as title, description, and keyword.

Note: The Salesforce Commerce Cloud (SFCC) users can get it for free from:

Let’s get started with the user guide to install, set up, and configure the ChatGPT to automate the work.

Note: The latest version is 1.0.0

 

Features Of AI Engine (ChatGPT) For Salesforce B2C Commerce

  1. It generates automatic product descriptions, product details, and SEO-related data.
  2. The option to choose text length.
  3. Option to choose response type as plain text or HTML.
  4. Generates product descriptions, product details, and SEO-related data in a single click.
  5. Option to regenerate individual responses using a custom prompt (query).
  6. Customizable prompt (query).

 

Installation of AI Engine (ChatGPT) For Salesforce B2C Commerce

There are two steps in the installation. First is deployment, and second is site import.

 

 

Deployment:

    • Run npm install to install all local dependencies (SFRA has been tested with v12.21.0 and is recommended).

 

    • Ensure that path : base is correct in the package.json file per your folder structure.

 

    • Run npm run compile:js from the command line that would compile all client-side JS files. Run npm run compile:scss that would do the same for CSS.

 

{

    “hostname”: “your-sandbox-hostname.demandware.net”,

    “username”: “AM username like [email protected]”,

    “password”: “your_webdav_access_key”,

    “code-version”: “version_to_upload_to”

}

    • Run npm run uploadCartridge. It will upload the wk_chatgpt_ai cartridge to the sandbox you specified in the dw.json file.

 

  • Add the wk_chatgpt_ai cartridge to your cartridge path
      • Go to the top menu and click on the drop-down arrow of Administration > Sites > Manage Sites

     

Manage sites option to select your site in SFCC for CHAT GPT

    • Then under the Business Manager Site, click the Business Manager option.

open Business-Manager to add path in SFCC for AI Engine ChatGPT

    • Now in the Settings tab, Paste the path wk_chatgpt_ai in the field Cartridges.
    • After that, click the Apply button.

add cartridge path in Business-Manager of SFCC AI Engine Chat GPT

To check that cartridge is uploaded successfully.

  • Administration > Site Development > Code Development

Code development to upload cartridge in SFCC for Chat GPT

  • Here check that your current code version is active.

Manage code version in SFCC Business-Manager

  • Now, click on the code version
  • In the File Filter box, type “wk_chatgpt” to check that the ChatGPT AI cartridge is uploaded successfully.

check ChatGPT AI cartridge is uploaded

 

Site Import:

 

  • To import the site, open SFCC Business Manager. 
    • Go to Administration > Site Development > Site Import & Export. 

Site Import Export option in SFCC menu

    • Select the Local option. Then click on Choose file button 
    • Upload the siteData.zip file that is in the root path of the zip file.
    • Then click on the Upload button.

Upload file in SFCC for ChatGPT

    • After that, select Instance/siteData.zip and click the Import button.

import zip file in SFCC for Chat GPT

  • Then click on the OK button and you can see that your data is imported successfully by scrolling down.

 

  • All right setup is complete.

 

How To Enable The Application “Commerce Cloud AI Engine- ChatGPT”

You have to do some configuration to make this application available to use. The configuration steps are as follows:

  • Administration >> Organization >> Roles & Permissions

Roles and Permissions for Salesforce Commerce Cloud AI Engine - Chat GPT

  • Click on the appropriate role if any as per your requirements. I have chosen the Administration role.

Administration role for Salesforce Commerce Cloud Engine- Chat GPT

  • Now go to the tab Business Manager Modules
  • Select your site in case you have multiple sites

Select the site for Salesforce Commerce cloud Engine- Chat GPT

  • Enable the ChatGPT module and click on the Update button from the bottom to save the settings.

enable ChatGPT application for SFCC

  • Click on the Merchant Tools bar from the top navigation option
  • Here you see that the ChatGPT application is now available.

ChatGPT application is now visible in SFCC

 

Configuration Of Application “AI Engine (ChatGPT) For Salesforce B2C Commerce”

  • Click on Merchant Tools
  • You will see the option for the application ChatGPT, click on it to open it
  • Then you will see that there are 2 options available Configuration and Product List.

Chat GPT options in SFCC

    • Configuration

      • Fill in the configuration details appropriately to configure the AI Engine (ChatGPT) For the SFCC B2C Commerce Cloud account.

Configuration of Chat GPT in Salesforce Commerce Cloud

      • To get the OCAPI Client ID and Password
      • Go to the Account Manager and click on API Client.
      • If you have an existing client API then select the one to whom you want to assign.
      • If you want to create a new one then click on the button Add API Client.

Select API client or create new one

      • When you click on the client ID to open it, you will see these details.
      • From this, you have to copy and paste the API Client to the SFCC field OCAPI client ID
      • Then provide the password you have set for this API client. If you forgot the password then change the password from the account manager then paste it into the configuration window of SFCC.

Configuration of Chat GPT in Salesforce Commerce Cloud

Open AI API Key will be available from your ChatGPT account

  • Login to your account (https://platform.openai.com/)
  • Then go to the API reference
  • Click on Personal from the top right side of the window
  • From the drop-down menu, select View API Keys

Chat GPT-OpenAI-API

        • On the API Keys page, click on the button Create new secret key.

Create new API-keys-OpenAI-API

        • Mention the name for which you are creating the key for your reference.
        • Then click on Create Secret key.

API keys creation - OpenAI API for SFCC

        • The key is generated and you have to copy and paste it in the notepad so that you can save it.
        • As soon as you click on Done then you are not able to copy the key as it is not visible anymore.
        • Now you see that the generated key is listed. You can edit (regenerate) or delete the generated key. 

API Keys list in Chat GPT

        • You have to paste this key into the Salesforce Commerce Cloud Engine- ChatGPT configuration page.
      • After configuration, you have to provide some permissions into your Open Commerce API Settings
        • For this go to Administration >> Site Development >> Open Commerce API Settings.

Open Commerce API settings in SFCC for AI engine ChatGPT

      • The permissions should look like this. Verify the permissions and mention the missing permissions in your Open Commerce API Settings that are missing in SFCC.
/** Code to revoke access from Salesforce token via cURL.
*
* @category Salesforce
* @author Webkul Software Pvt Ltd <[email protected]>;
* @copyright 2023 webkul.com. All Rights Reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @link http://webkul.uvdesk.com
*/

{
  “_v”: “23.2”,
  “clients”: [
  {
    “client_id”: “Paste the client API ID here“,
    “resources”: [
    {
      “resource_id”: “/product_search”,
      “methods”: [
        “post”
      ],
      “read_attributes”: “(**)”,
      “write_attributes”: “(**)”
    },
    {
      “resource_id”: “/products/*”,
      “methods”: [
        “get”,
        “patch”,
        “put”
      ],
      “read_attributes”: “(**)”,
      “write_attributes”: “(**)”
    },
    {
      “resource_id”: “/catalog_search”,
      “methods”: [
        “post”
      ],
      “read_attributes”: “(**)”,
      “write_attributes”: “(**)”
    }
    ]}
  ]
}
      • Then click on the Save button to save the permissions.

Product List:

      • Click the New button from the bottom right side

Create new product in Salesforce Commerce cloud

      • Fill in the details of your new product.
      • In this section, you can take advantage of the application ChatGPT.
      • After entering the Product ID, catalog, and name click on Generate content.

Chat GPT generates content for product list

      • The ChatGPT will generate the content for the description and product details fields.
      • After generating the content, you can also modify it by clicking on Modify content.
      • Then click on Generate button.

Content modification using Salesforce commerce cloud engine- Chat GPT

      • It will generate new modified content for that specific field.
      • If you want to edit the content in the HTML editor then click on the HTML Editor option.
      • It redirects you to another window where you can change your content for the new product.
      • Then click the OK button from the bottom right side of the window.

HTML Editor for new content generated by Chat GPT

      • In SEO Support, you can modify the content 
      • After modifications, click the button as per your requirements
        • If you are done then click Apply and Go to the product default edit page.
        • If you want other modifications, click the Apply and Stay on this page button.
      • Hit the Save button in the pop-up box.

SEO support content by Chat GPT in SFCC site

Note: If you want to modify it then click on Modify Content and generate specific content in their respective fields. You can also write it on your own in the fields directly.

      • It will show you a full page of the product where you can add many more details related to the product if you want to.

Detailed product page in SFCC

      • Then go to the product list and your product will be displayed.

Product list in Salesforce Commerce Cloud

At last, you are all done with the installation, configuration, and product addition. So you see how easy it is to use the SFCC B2C AI Engine- ChatGPT. This makes your work easier. Also, you don’t have to think twice regarding the descriptions before listing any product on your site.

 

Salesforce AppExchange Consulting Profile

We are a business software development, consulting, and PDO firm with 13+ years of experience. We provide services for different Salesforce clouds such as Sales Cloud, Marketing Cloud, Health Cloud, Commerce Cloud, Service Cloud, and Experience Cloud. Also, we have a team of certified Salesforce developers and dedicated Salesforce Consultants. There are more than 10 applications that we have published on the Salesforce AppExchange.

Please visit the Webkul Consulting Profile to check our expertise and partner navigator achievements

 

Support

Leave a Comment

Comments (0)

Please verify that you are not a robot.

Welcome back

Welcome back! Please enter your details

One or more fields have an error. Please check and try again.

Forgot Password?

Tell us about Your Company

How can we help you with your business?