Code Monkey home page Code Monkey logo

b2b-commerce-on-lightning-quickstart's Introduction

b2b-commerce-for-lightning

This repository has a set of useful reference implementations for the B2B Lightning projects. It is structured in 2 parts: examples and sfdx.

WARNING! By following the setup instructions for this tool (in the examples, as well as in the sfdx section), the sharing settings of your org will be updated! See in this folder what sharing settings will be modified and how. In addition to those, the newly created user profiles (for buyer user and guest) will have the user permissions and CRUD access object permissions automatically updated.

The examples include metadata API sources that can help to setup a B2B project and provide examples for a quick start with this project. They can be deployed as described in the Salesforce documentation here. The examples contain 3 folders:

  1. checkout covers information and instructions on how to deploy each of the components required to build a fully working checkout for a B2B Store. Flows are setup here. Mock integrations are provided here. Notifications are provided here.
  2. diagnostic sets up a diagnostic workflow that allows you to debug issues that could occur during checkout of your store.
  3. users covers how to deploy an org, a buyer user profile, and a guest user profile, with the settings required. Instructions on how to deploy a buyer profile for your B2B store here. Instructions on how to deploy a guest user profile for your B2B store here. Sharing settings that need to be enabled are covered here.

The sfdx section is aimed to the developers who use the SFDX environment. There are no source files in this section, they will be converted from the metadata format (in "examples") to the SFDX format by running the script in the sfdx directory. After the conversion to the SFDX format it is the developer's responsibility to maintain the files and continue working with them in the new SFDX project.

b2b-commerce-on-lightning-quickstart's People

Contributors

54chi avatar ashley-mcguire avatar ashrelateiq avatar cnastasa avatar dan-zak avatar gkhunger-sf avatar jamesquinn103 avatar jarndt-ltm avatar kalyanboya avatar patricksullivansf avatar pmaliwat avatar shrej avatar smolynsf avatar svc-scm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

b2b-commerce-on-lightning-quickstart's Issues

Replace hard coded strings with custom labels

The reference implementation code has hard coded strings everywhere. The Salesforce recommended best practice is to use Custom Labels instead, since they are translatable and editable through configuration (no need for code changes).

Currently, if a customer admin wants to change text from one of the quick start pages after it has been deployed, they would need to edit the LWC code (not an admin function). If the quickstart code was written with Salesforce best practices to not hard code strings, the admins would only just need to edit a custom label.

Because hard coded strings are used everywhere in the quickstart, and the quickstart is used for all custom PLP/PDP pages as a starting point, it is likely that Salesforce customers are being delivered less maintainable implementations with hard coded strings.

Error: Order Products must have a Price Book Entry that belongs to the Price Book related to the parent Order.: Price Book Entry ID

Using default checkout for testing purposes

I am able to get to the cart to order action, which throws this error.

The product I have in cart is in a pricebook (the store pricebook).
This pricebook is connected to the user's buyer group as well.
The product also is in the standard price book.
For testing purposes, I also added the "Shipping charge for this delivery method" ghost Product to the price book to no avail.

3 Questions:

  • Any input on why this is happening? Previously seen before?
  • How does a cart associate the order to the correct pricebook during the cart to order action?
  • Is the "Cart to Order" action source code available somewhere? I believe it's built in and that the answer is no, but it'd be helpful to know how it works internally instead of dealing with a black box.

Thank you,
Pierre-Alexandre

When running ./quickstart-setup-store.sh test I recieve the following error

ERROR running force:data:tree:import: {"hasErrors":true,"results":[{"referenceId":"PricebookEntryRef2","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef4","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef6","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef8","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef10","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef12","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef14","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef16","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef18","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef20","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef22","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef24","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef26","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef28","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef30","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef32","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]},{"referenceId":"PricebookEntryRef34","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Pricebook2Id]","fields":["Pricebook2Id"]}]}]} 5. Mapping Admin User to Role. ERROR running force:data:record:update: An unexpected error occurred. Please include this ErrorId if you contact support: 1677524363-167767 (2074184818) 6. Creating Buyer User with associated Contact and Account. ERROR running force:user:create: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, portal account owner must have a role: [] Making Account a Buyer Account. ERROR running force:data:record:create: Required fields are missing: [BuyerId] Assigning Buyer Account to Buyer Group. ERROR running force:data:record:create: Required fields are missing: [BuyerId]

Simple_B2B_Checkout.flow is misnamed

The following file:

examples/checkout-sync/flows/Simple_B2B_Checkout.flow

Is incorrectly named. It can't be deployed via SFDX.

This file should be renamed to:

examples/checkout-sync/flows/Simple_B2B_Checkout.flow-meta.xml

The CartDeliveryGroup '<id>' does not have an OrderDeliveryMethod.

Hi there,

Trying to run the flow with basic settings and integrations.

When I get to the "Cart to Order" step, I always get this message. Debugging the flow has been no help.

I queried the CartDeliveryGroup, CartDeliveryGroupMethod objects they do have a key pointing to an OrderDeliveryMethod.

Any idea why this happens?

image

I'm getting error in stripe integration

invalid_request_error
Sending credit card numbers directly to the Stripe API is generally unsafe. We suggest you use test tokens that map to the test card you are using, see https://stripe.com/docs/testing. To enable raw card data APIs in test mode,
image

If I'm passing test token then the error I'm getting

secret_key_required
Looks like you forgot to include an API key in your request.

You can find a list of your configured keys on the API

image

Stripe Payment Gateway Integration

Hi,

I'm trying to implement Stripe Integration for Lightning B2B Commerce Checkout flow.
The provided example of StripeAdapter tries to query the CardPaymentMethod in createAuthResponse() using Id from AuthApiPaymentMethodRequest to get the GatewayToken and assign it as a 'source' to create a Charge. However, AuthApiPaymentMethodRequest has blank Id, and there are no records of type CardPaymentMethod inserted during the checkout flow.
Can you please explain what I'm missing here? At what point in time do we get a Token from Stripe and when do we create a CardPaymentMethod records with this info saved in the GatewayToken field?

issue with cart components

I've updated my store to use the cartSummary and cartContents components. I've encountered an issue when I return to the cart from checkout. Here's how to reproduce:

  1. Add an item to the cart
  2. Click [Proceed to checkout]
  3. When the first checkout screen appears, click on the cart icon above the checkout flow
  4. The cart appears. The cartContents component renders, but the cartSummary does not.
  5. The spinner gif keeps spinning, but never disappears.

Would someone be able to fix this?

Issues Deploying To Sandbox With Workbench

I am trying to deploy the code (checkout-reentrant) to my sandbox using workbench and i am getting 3 Component Failures

  1. OrderSummary.sfdc_Checkout_Order_Summary_Email_Alert - problem: Not in package.xml
  2. sfdc_Checkout_Order_Summary_Notification_Flow - problem: Order_Summary_Email_Alert_Action (Action) - We can't find an action with the name and action type that you specified.
  3. sfdc_Checkout_Notify_On_Order_Summary_Created_Event - problem: myRule_1_A1 (Action) - We can't find an action with the name and action type that you specified.

any help would be appreciated

Error running ./convert-examples-to-sfdx.sh

I clone the repo and change to sfdx directory. When I run ./convert-examples-to-sfdx.sh getting below error.

Appreciate any feedback.

M4L577TC2Y:sfdx patelgv$ ./convert-examples-to-sfdx.sh
ERROR running force:mdapi:convert: InvalidPackageDirectory
ERROR running force:mdapi:convert: InvalidPackageDirectory
ERROR running force:mdapi:convert: InvalidPackageDirectory
ERROR running force:mdapi:convert: InvalidPackageDirectory
ERROR running force:mdapi:convert: InvalidPackageDirectory
ERROR running force:mdapi:convert: InvalidPackageDirectory
ERROR running force:mdapi:convert: InvalidPackageDirectory
mkdir: force-app/main/default: No such file or directory
cp: force-app/main/default/classes is not a directory
cp: force-app/main/default/classes is not a directory
cp: force-app/main/default/classes is not a directory
cp: force-app/main/default/classes is not a directory
cp: force-app/main/default/lwc: No such file or directory
cp: ../examples/lwc/force-app/main/default/lwc/paymentMethod: unable to copy extended attributes to force-app/main/default/lwc: No such file or directory
cp: force-app/main/default/lwc/constants.js: No such file or directory
cp: force-app/main/default/lwc/paymentMethod.css: No such file or directory
cp: force-app/main/default/lwc/paymentMethod.html: No such file or directory
cp: force-app/main/default/lwc/paymentMethod.js: No such file or directory
cp: force-app/main/default/lwc/paymentMethod.js-meta.xml: No such file or directory
cp: force-app/main/default/lwc: No such file or directory
cp: ../examples/lwc/force-app/main/default/lwc/billingAddressSelector: unable to copy extended attributes to force-app/main/default/lwc: No such file or directory
cp: force-app/main/default/lwc/billingAddressSelector.html: No such file or directory
cp: force-app/main/default/lwc/billingAddressSelector.js-meta.xml: No such file or directory
cp: force-app/main/default/lwc/billingAddressSelector.js: No such file or directory
cp: force-app/main/default/lwc: No such file or directory
cp: ../examples/lwc/force-app/main/default/lwc/cardPaymentMethod: unable to copy extended attributes to force-app/main/default/lwc: No such file or directory
cp: force-app/main/default/lwc/constants.js: No such file or directory
cp: force-app/main/default/lwc/cardPaymentMethod.js: No such file or directory
cp: force-app/main/default/lwc/cardPaymentMethod.html: No such file or directory
cp: force-app/main/default/lwc/cardPaymentMethod.css: No such file or directory
cp: force-app/main/default/lwc/cardPaymentMethod.js-meta.xml: No such file or directory
cp: force-app/main/default/lwc: No such file or directory
cp: ../examples/lwc/force-app/main/default/lwc/navigationButtons: unable to copy extended attributes to force-app/main/default/lwc: No such file or directory
cp: force-app/main/default/lwc/navigationButtons.js: No such file or directory
cp: force-app/main/default/lwc/navigationButtons.js-meta.xml: No such file or directory
cp: force-app/main/default/lwc/navigationButtons.html: No such file or directory
ERROR running force:mdapi:convert: InvalidPackageDirectory

Converted the main checkout flow.
M4L577TC2Y:sfdx patelgv$

Error while creating store using the CLI

Calculate_Cart_Promotions (Action) - We can't find an action with the name and action type that you specified.

This is the error that is popping up and the push is failing.

Can someone help?

Scratch Org Error on Creation - Commerce does not exist.

After testing multiple times to setup a scratch org I've received this message.

Command:

sfdx force:org:create -f config/project-scratch-def.json username=[email protected]` -s -d 15

Error:

=== Component Failures [1]
TYPE FILE NAME PROBLEM
Error shape/package.xml The object 'Commerce' of type Settings metadata does not exist.

at the same time the scratch org IS created, but when I continue to the next step and run + provide a store name. This error continues to repeat every 10 seconds.

Command:

./quickstart-create-and-setup-store.sh

Error:

ERROR at Row:1:Column:16
sObject type 'WebStore' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.
Store not yet created, waiting 10 seconds...
Querying Data... done
ERROR running force:data:soql:query:
SELECT Id FROM WebStore WHERE Name='scratchstore'

Outcome:
A scratch org exists but no store is created

B2BUtils tests - inserting WebStoreNetwork

I'm trying to create a test for B2BUtils.resolveCommunityIdToWebstoreId and am running into problems creating the WebStoreNetwork in my @testsetup

@isTest
private class B2BUtilsTest {
    @testSetup static void setup() {
        WebStore testWebStore = new WebStore(Name='TestWebStore', DefaultLanguage='en_US');
        insert testWebStore;
        
        WebStoreNetwork testWebStoreNetwork = new WebStoreNetwork(WebStoreId=testWebStore.Id);
        insert testWebStoreNetwork;
    }

In the Developer Console, I see the following errors:

  • Field is not writeable: WebStoreNetwork.WebStoreId
  • DML operation Insert not allowed on WebStoreNetwork

I extremely new to Salesforce development and apologize if this problem has an obvious solution. I'm not able to find any documentation on the WebStoreNetwork object or how to create one.

On a side note, if this repo is really intended to be a quickstart, it seems like a bare minimum requirement would be 75% test coverage on the included utility classes. Currently, there are at least four classes that have no tests whatsoever: B2BCartToOrderDraft, B2BGetInfo, B2BUtils and SalesforceAdapter

Please provide Test Class for the StripeAdapter.cls Class

Thanks a lot for sharing the StripeAdapter.cls in here https://github.com/forcedotcom/b2b-commerce-on-lightning-quickstart/tree/master/examples/checkout/payment-gateway-integration/Stripe/classes

StripeAdapter Class is a good starting point. However, its incomplete without the test class. It would be useful for the Apex unit tests to be included. We are currently stuck without the test class. And am sure there are other people facing the same problem.

Please get the Test Class included.

Thanks

Unable to use B2BSearchControllerSample.productSearch with effectiveAccountId and Named Principal Named Credential so unable to display prices

We’ve run into an issue with the reference component that uses the REST Connect API for searching that we need to use for a custom Category / Search Results.

B2BSearchControllerSample.productSearch:

That calls the product-search endpoint.

httpRequest.setEndpoint(
'callout:CallMeBack/services/data/v' +
apiVersionApexClass +
'/commerce/webstores/' +
webstoreId +
'/search/product-search'
);

The reference implementation ignores the effectiveAccountId (note it is a parameter to the Apex method, but never passed in the REST call), which means that pricing is not displayed. When we add it as specified in the documentation https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_product_search.htm

?effectiveAccountId=

We get an error:

[{​​​​​​​​"errorCode":"INVALID_API_INPUT","message":"Only a buyer user can access this account."}​​​​​​​​]

We followed the setup steps here for the Named Credential:

https://github.com/forcedotcom/b2b-commerce-on-lightning-quickstart/blob/master/examples/lwc/docs/NamedCredentials.md

The problem is that our Named Principal doesn’t have the Buyer User system permission. So, we created a permission set to assign it to our Named Principal user, but it is not possible. We get an error that the Buyer User permission is not applicable for the license type of our Named Principal, which is Salesforce (also doesn’t work for Platform). However, there is no way to create a named principal for the Named Credential that is a Community Login User and we cannot do it on a Per User basis either, because that would require the store users to go through the webflow for oauth which we obviously cannot do.

We are stuck on not being able to use this AND display pricing.

Ideally, the reference implementation should be updated to not ignore the effectiveAccountId parameter since it is more likely that prices would be desired in the search results than not. At least, if it is not possible, that should be documented.

quickstart-create-and-setup-store "B2B Commerce" template error

running ./quickstart-create-and-setup-store.sh products the following error:

ERROR running force:community:create:  The specified template does not exist.

Store not yet created, waiting 10 seconds...
Querying Data... done
ERROR running force:data:soql:query:  
SELECT Id FROM WebStore WHERE Name='balance' LIMIT
               ^
ERROR at Row:1:Column:16
sObject type 'WebStore' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

when I list my available templates this is what I get:

sfdx force:community:template:list
=== Site list template result
TEMPLATE NAME                  PUBLISHER
─────────────────────────────  ──────────
Build Your Own                 Salesforce
Help Center                    Salesforce
Customer Account Portal        Salesforce
Aloha                          Salesforce
Customer Service               Salesforce
Build Your Own (LWR)           Salesforce
Salesforce Tabs + Visualforce  Salesforce


Looks like script is broken, has anybody else run into this?

Error while trying to run ./quickstart-setup-store.sh to Create store in Scratchorg

./quickstart-setup-store.sh while running this command to create B2B Commerce Store in Scratch ogr from Visual studio code , i get error "C;/Program is not recognized as an internal or external command ,operable or batch file "
I have set up path envronment variables , C:\Program Files\Git\Cmd but error still not resolved . Please advise how to resolve this error

productDetailsDisplay component

Currently, the productDetailsDisplay component does not display pricing tiers or a drop-down for product variants. Will this component be updated to include those elements?

Can't push data to the scratch org (flow error's)

Hello everyone, first of all, thank you for giving us a project to set up a store and try it out!

When I try to push data to scratch org I'm getting the error "Invalid version specified:51.0" so I've changed the sfdx-project.json file to "sourceApiVersion": "50.0" and all XML files to 50.0, now when I run the push command I'm getting those errors:

  • "Error force-app\main\default\flows\Process_CommerceDiagnosticEvents.flow-meta.xml Error parsing file: Element {http://soap.sforce.com/2006/04/metadata}flowTransactionModel invalid at this location in type FlowActionCall (19:31)
  • Error force-app\main\default\flows\Spring_2021_Subflow_Delivery_Method.flow-meta.xml Error parsing file: 'setCheckoutDeliveryMethod' is not a valid value for the
    enum 'InvocableActionType' (19:59)
  • Error force-app\main\default\flows\Spring_2021_Subflow_Checkout_Summary.flow-meta.xml deliveryMethod (Screen Component) - We can't find this input attribute: "isReadOnly".
  • Error force-app\main\default\flows\Spring_2021_Checkout.flow-meta.xml Delivery_Method (Subflow) - The flow Spring_2021_Subflow_Delivery_Method doesn't exist.

ERROR running force:source:push: Push failed."

Maybe it's related to the org version, I don't really know.

Could you help, please?

Payeezy Integration results in 403

Using the supplied example for Payeezy and creating a new account in Payeezy to use the apiKey and merchant token respectively results in the following response:

{
    "code": "403",
    "message": "HMAC validation Failure"
}

Please provide Test Class for the B2BGetInfo.cls Class

Thanks a lot for sharing the B2BGetInfo.cls in here https://github.com/forcedotcom/b2b-commerce-on-lightning-quickstart/tree/master/examples/lwc/force-app/main/default/classes

B2BGetInfoClass is a good starting point. However, it's incomplete without the test class. It would be useful for the Apex unit tests to be included. We are currently stuck without the test class. And am sure there are other people facing the same problem.

Please get the Test Class included.

Thanks

scratch b2bcommerce feature not available

Hi

I followed the instructions and created the scratch org using the project-scratch-def.json however when I open the scratch org and check installed packages I see no B2B commerce package is installed and in object manager I do not see any of the B2B commerce objects such as WebStore Please help me how to fix this?

bash: zip: command not found

While running the below command I am facing issue saying "bash: zip: command not found"

$ zip -r -X ../"$communityExperienceBundleName"ToDeploy.zip *

This command is part of "quickStart-setup-store.sh"

Associate existing community to created store

We are using B2B Commerce Lightning in Production. We created a Dev sandbox from Production. This restored Community Site but not Store.

Hence we used 'b2b-commerce-on-lightning-quickstart' to create Store & created one Store successfully. But any new Store created also creates its related Community site.

Here we want to associate newly created Store to an existing Community site. We found a junction object 'WebStoreNetwork' which maps Community Site (Network) to Store (WebStore). But its records are not editable or deletable.

We need your direction to associate newly created Store to an existing Community site.

Checkout flow error on click of checkout button

I am getting error as soon as I click checkout button, saying "An error occurred with the flow. Contact your admin for more information."
When I debugged the flow I am getting error saying "Looks like you're not allowed to use checkout actions. Your account rep can help with that. ".
Can anyone help? Thanks in advance.

Special characters are incorrectly displayed as html entities in PLP

The filters of the PLP display special characters such as & and " as their html entities & and ". The built-in Results Layout component does not have the same problem It outputs & and " as they are.

The code should be fixed to address this bug. Currently anyone that codes a custom PLP will start with this lightning quickstart, which means that all of Salesforce's customers that have a custom PLP have this problem. It's possible that this happens in other areas of code as well, but I've noticed it on the PLP search result filters.

image

Unable to create community

On Step 5.

./quickstart-create-store.sh

Looks good in console, but then I get an error email from Salesforce:

Hello User User,
An error prevented us from creating the Lightning community.
We've logged the following error:
An unexpected error occurred. Try again or contact your Salesforce administrator for help.
Contact your Salesforce admin for further assistance.

Error while trying to run ./quickstart-setup-store.sh to Create store in Scratch org #40 Reopen

I was setting up store by following this instructions. The first three steps work fine but the fourth step throws an error.

✅ 1. Clone the whole b2b-commerce-for-lightning repository:
✅ 2. From the sfdx directory, run the script
✅ 3. Create a scratch org using SFDX: If you don't have a dev hub already authorized, do that now by running
sfdx force:auth:web:login -d
4. Make sure that your current directory is sfdx and create and setup a new store in your new scratch org by running the following script:

_./quickstart-create-and-setup-store.sh_

Error "C;/Program is not recognized as an internal or external command ,operable or batch file "

Commerce Search Refinement doesn't work with picklist fields

Hi,
I am implementing commerce search using Connect API
Rest Connect API
Apex Connect API
Unfortunately I cannot filter search results by picklist field value.
B2B Commerce on Lightning Doc states that picklist type is supported.

This is a sample of my code:

`

     CommerceSearchDomain.SearchProductsWrapper searchProductsWrapper = new CommerceSearchDomain.SearchProductsWrapper();

    searchProductsWrapper.webstoreId = input.webstoreId;

    searchProductsWrapper.productSearchInput = new ConnectApi.ProductSearchInput();

    searchProductsWrapper.productSearchInput.pageSize = APP_CommerceCatalogAPI.DEFAULT_SEARCH_PRODUCTS_SIZE;

    searchProductsWrapper.productSearchInput.page = input.pageNumber;

    searchProductsWrapper.productSearchInput.searchTerm = input.searchTerm;

    ConnectApi.DistinctValueRefinementInput refinementInput = new ConnectApi.DistinctValueRefinementInput();

    refinementInput.values = new List<String>{'HE'};

    refinementInput.nameOrId = 'Orders_3__c';

    refinementInput.type = ConnectApi.CommerceSearchFacetType.DistinctValue;

    refinementInput.attributeType = ConnectApi.CommerceSearchAttributeType.Custom;

    searchProductsWrapper.productSearchInput.refinements = new List<ConnectApi.RefinementInput>{refinementInput};

`

Picklist field values:
image

Running SOQL as B2B user returns Product records with correct value in specified field.
But commerce search returns an empty response whenever I try to specify value in Refinement. For empty refinements list it returns every record (accessible by user).

I tried to check other fields and using Checkbox field gives proper results from the Webstore Search.

Before using fields as search filters I configure commerce setup and rebuild search index
image

Any ideas what is missing in my code or configuration? Anyone had this issue before?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.