Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ function ShopperAgentWindow({commerceAgent, locale, domainUrl, basketId}) {
scrt2Url,
salesforceOrgId,
commerceOrgId,
siteId
siteId,
cartUrl
} = JSON.parse(commerceAgent)

const {usid} = useUsid()
Expand All @@ -124,7 +125,8 @@ function ShopperAgentWindow({commerceAgent, locale, domainUrl, basketId}) {
SiteId: siteId,
Locale: locale,
OrganizationId: commerceOrgId,
UsId: usid
UsId: usid,
CartURL: cartUrl
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const commerceAgentSettings = {
scrt2Url: 'https://myorg.salesforce.com-scrt.com',
salesforceOrgId: 'mock_salesforce_org_id',
commerceOrgId: 'mock_ecom_id',
siteId: 'RefArchGlobal'
siteId: 'RefArchGlobal',
cartUrl: 'https://mocksite.com/cart'
}

const commerceAgentSettingsString = JSON.stringify(commerceAgentSettings)
Expand All @@ -56,7 +57,8 @@ describe('ShopperAgent Component', () => {
domainUrl: 'https://myorg.salesforce.com',
basketId: '4a67cda5b1b9325a29207854c1',
locale: 'en-US',
basketDoneLoading: true
basketDoneLoading: true,
cartUrl: 'https://mocksite.com/cart'
}

beforeEach(() => {
Expand Down Expand Up @@ -176,7 +178,8 @@ describe('ShopperAgent Component', () => {
Locale: defaultProps.locale,
OrganizationId: commerceAgentSettings.commerceOrgId,
SiteId: commerceAgentSettings.siteId,
UsId: 'test-usid'
UsId: 'test-usid',
CartURL: defaultProps.cartUrl
})

// Reset mock to test button click event
Expand Down
3 changes: 2 additions & 1 deletion packages/template-retail-react-app/config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const defaultCommerceAgentSettings = {
scrt2Url: 'https://orgfarm-1645fa246c.test1.my.pc-rnd.salesforce-scrt.com',
salesforceOrgId: '00DSG00000RBHqn',
commerceOrgId: 'f_ecom_zzeu_052',
siteId: 'RefArchGlobal'
siteId: 'RefArchGlobal',
cartUrl: 'https://agentgatos-production.mobify-storefront.com/cart'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it work with site/locale config here? If the customer sets up the storefront to have site/locale as path, the cart page would become /siteId/en-GB/cart.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I've talked to Mukul about this, for now we might have to reconstruct the cart link via agentforce incorporating the locale? But users could also choose to have a completely separate convention.

Do you now if there is an ECOM API where we can get a cart link? We couldn't find one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, no. pwa-kit constructs url based on the config.app.url within the code base and not based on any ECOM API atm. To see how we construct url. See here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI spun up another work item to sync up with Mukul and Thomas Loche around this. For now, I'm merging to our branch to unblock the Cart teams for integration purposes.

}

module.exports = {
Expand Down
Loading