Learn What’s New for B2C Commerce Developers
After completing this unit, you’ll be able to:
- Use the new Storefront Toolkit to get information about your storefront.
- Use Salesforce CMS content in Page Designer components.
- Get ready for the Google Chrome 80 cookie change.
- Use flexible on-demand sandboxes.
- Improve performance with a custom cache.
- Review important new Job and Schedules features in the last year.
The new Storefront Toolkit provides increased security and performance over the previous version of the Storefront Toolkit, which is now deprecated.
The new Storefront Toolkit includes the following tools.
- Page Information tool: Displays information about the templates, controllers, and pipelines associated with a component.
- Content Information tool: Displays links to the product, content asset, or content slot associated with a component.
- Search Information tool: Displays sorting rule and search scoring information for a search result.
- Cache Information tool: Indicates which components are cached and includes information you can use to determine the cost of caching portions of a page.
- Request Log: Displays log entries related to requests to the server from the storefront.
- Site Preview Settings tool: Lets you view the storefront as it would appear at a specific date, for certain customer groups, or for a particular A/B test segment.
How: To access the new Storefront Toolkit, in Business Manager, select the site to view. Click Toolkit at the top of the navigation bar. The storefront opens with the Storefront Toolkit icons in the upper right corner of the page.
If you use the new Storefront Toolkit, we recommend that you disable the previous Storefront Toolkit at Merchant Tools | Site Preferences | Deprecated Storefront Toolkit Preferences.
Create and manage content in Salesforce Content Management System (CMS). Easily use that content in components on Page Designer pages.
Salesforce CMS is an API-first headless content service providing centralized out-of-the-box functionality native to the Salesforce Platform. With this integration, merchants are able to access CMS content within Page Designer pages and build custom components that map to CMS content. All of this is possible after a one-time setup between Salesforce CMS and B2C Commerce.
How: To use Salesforce CMS content on Page Designer pages.
- Establish a one-time trust relationship between your Salesforce org and B2C Commerce instance.
- Set up a workspace and channel in Salesforce CMS for B2C Commerce content.
- In Business Manager, assign your site library to the CMS channel.
- Develop a component type with an attribute assigned to a CMS record.
- When configuring the component attribute in the visual editor, select the CMS record to use.
For details, see Infocenter: Use Salesforce CMS Content with Page Designer.
Why: These changes ensure that cookies behave as expected after the Chrome 80 release. The B2C platform specifies SameSite=None for cookies from the server. You have to enable the global security preference Enforce HTTPS so that the server can mark cookies with the Secure attribute and specify SameSite=None. If Enforce HTTPS is not enabled, the server does not specify the SameSite attribute. In that case, the browser uses its own default SiteSame setting and might not send cookies in cross-site contexts. Depending on the significance of the cookie, not sending it can break critical site functionality.
We recommend that you test enabling Enforce HTTPS on a nonproduction instance before implementing the change on a production instance.
How: To enable Enforce HTTPS, in Business Manager, go to Administration | Global Preferences | Security. On the Access Restrictions tab, select Enforce HTTPS. Click Apply.
B2C Commerce on-demand sandboxes, an alternative to traditional POD-based sandboxes, can be acquired quickly, have improved performance, and can be used as part of a CI/CD process. You control how many sandboxes you use and when you use them. A usage-based pricing model allows you the flexibility to keep just a few sandboxes running for an extended period or create many short-term sandboxes.
On-demand sandbox features include:
- Sandbox management using self-service APIs
- OCAPI and WebDAV settings configurable on sandbox creation
- A time-to-live option that deletes sandboxes after a specified time, minimizing costs
- Usage-based pricing based on credits consumed for sandbox uptime and downtime
A custom cache can help you improve code performance by reusing data that is expensive to calculate, takes a long time to retrieve, or is accessed frequently. The new custom cache framework supports caching simple and structured data between requests.
How: Define a custom cache in a JSON file in a custom cartridge. Store and retrieve objects from the cache using the dw.system.CacheMgr and dw.system.Cache B2C Commerce script API classes. Enable or disable caching, monitor cache statistics, and clear caches in Business Manager at Administration | Operations | Custom Caches.
Review these new B2C Commerce Jobs and Schedules features.
Use Job Steps Instead of Pipelets
Why: Instead of having to write pipelines, you can easily create jobs using the new job framework and the system steps.
How: Use these new system steps to create jobs. The pipelet with similar functionality is listed in parentheses.
- ExecuteDataReplication (TriggerReplication)
- ExportABTests (ExportABTests)
- ExportContent (ExportContent)
- ExportContentSlots (ExportSlots)
- ExportCouponCodes (ExportCouponCodes)
- ExportCoupons (ExportCoupons)
- ExportCustomerList (ExportCustomerList)
- ExportCustomers (ExportCustomers)
- ExportCustomerGroups (ExportCustomerGroups)
- ExportCustomObjects (ExportCustomObjects)
- ExportGiftCertificates (ExportGiftCertificates)
- ExportInventoryLists (ExportInventoryLists)
- ExportMetaData (ExportMetaData)
- ExportProductLists (ExportProductLists)
- ExportPromotions (ExportPromotions)
- ExportShippingMethods (ExportShippingMethods)
- ExportSourceCodeGroups (ExportSourceCodes)
- ExportStores (ExportStores)
- ImportABTests (ImportABTests)
- ImportActiveData (ImportActiveData)
- ImportContent (ImportContent)
- ImportContentSlots (ImportSlots)
- ImportCoupons (ImportCoupons)
- ImportCustomerGroups (ImportCustomerGroups)
- ImportCustomerList (ImportCustomerList)
- ImportCustomers (ImportCustomers)
- ImportGiftCertificates (ImportGiftCertificates)
- ImportInventoryLists (ImportInventoryLists)
- ImportProductLists (ImportProductLists)
- ImportPromotions (ImportPromotions )
- ImportShippingMethods (ImportShippingMethods)
- ImportSourceCodeGroups (ImportSourceCodes)
- ImportStores (ImportStores)
- ImportTaxTable (ImportTaxTable)
- InvalidateCache (InvalidateWebCache)
Import and Export Job Step Failures Include Reason (19.7 Release)
When an import or export job step fails, the reason for the failure is included in the status message returned by the OCAPI Data APIs. The message includes details about the failure, for example, if it is a locking problem or validation problem. Previously, only a generic message was returned and you had to review log files to determine the cause of the error.
ImportFailedHandling Job Step Parameter Behavior Changes (19.5 Release)
If you select ERROR as the value for the ImportFailedHandling job step parameter, the action configured for the AfterImportFileHandling parameter no longer executes for invalid files. Previously, the step stopped, but the action specified by AfterImportFileHandling was executed on the invalid file and also other files that hadn't been imported yet. This behavior made it hard to design jobs so that they didn’t process new import files until an administrator reviewed the problem. The default for ImportFailedHandling also changed from ERROR to WARN.
AfterImportFileHandling Isn’t Executed After Transient Error (19.5 Release)
When an import job step encounters a transient error, like resource locking, the action specified by the AfterImportFileHandling parameter isn't executed. This parameter specifies what to do with import files after an import process completes. For example, you can specify that the files be zipped and archived or deleted. Previously, if an import job step encountered a transient error, the action you specified for AfterImportFileHandling was executed, although the objects weren’t imported. Now the action is not executed, and the import files are kept in place, ready to be processed by another execution of the import job.
Identify Files Not Found During Import (19.5 Release)
The NoFilesFoundHandling job step parameter specifies the exit status code to use if the import job step doesn't find files that match the specified pattern for importing. Use the parameter’s new NO_FILES_FOUND option to identify this error situation and take appropriate action.
How: To use the new default value, within a job, click Configure a Step. Select an import job step. The preconfigured value for NoFilesFoundHandling is NO_FILES_FOUND. In the Error Handling section of the Select and Configure Step window, the error code NO_FILES_FOUND is available.
Archived Import Files Are Prefixed with the Job and Step IDs (19.5 Release)
Before an import file is archived, the IDs of the job and job step are added to the file name as a prefix. When you set the AfterImportFileHandling parameter to Archive, import files are moved to the archive folder after the import process finishes. Previously,
if the archive folder contained an import file with the same name, an error was returned because the file couldn’t be archived. By adding the job and step IDs, each import file now has a unique name. For example, if the import file is named
the archived file is something like