Erfassen Sie Ihre Fortschritte
Trailhead-Startseite
Trailhead-Startseite

Learn What’s New for B2C Commerce Developers

Learning Objectives

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.

Get Information About the Content and Performance of Your Storefront (20.2 Release)

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.

Use Salesforce CMS Content in Page Designer Components (20.2 Release)

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.

  1. Establish a one-time trust relationship between your Salesforce org and B2C Commerce instance.
  2. Set up a workspace and channel in Salesforce CMS for B2C Commerce content.
  3. In Business Manager, assign your site library to the CMS channel.
  4. Develop a component type with an attribute assigned to a CMS record.
  5. 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.

Google Chrome 80 introduces a new default cookie attribute setting of SameSite=Lax. Previously, the SameSite cookie attribute defaulted to SameSite=None. Also new with Chrome 80, when SameSite is set to None, cookies must be tagged with the Secure attribute indicating that they require an encrypted HTTPS connection. Other browser vendors are expected to make similar changes soon. To get ready for the changes, enable the global security preference Enforce HTTPS. Also, test to see if client-side JavaScript code requires adjustments and to make sure that third-party integrations work as expected.

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. 

If you set cookies using custom client-side JavaScript, test to determine if your code requires adjustments to accommodate the Chrome 80 changes. Also, test cross-site scenarios to make sure that third-party integrations work as expected with the Chrome 80 changes.

How: To enable Enforce HTTPS, in Business Manager, go to Administration | Global Preferences | Security. On the Access Restrictions tab, select Enforce HTTPS. Click Apply.

Use Flexible On-Demand Sandboxes (19.9 Release)

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

Improve Performance with a Custom Cache (19.8 Release)

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.

Important New Jobs and Schedules Features

Review these new B2C Commerce Jobs and Schedules features.

Use Job Steps Instead of Pipelets

Developers can now implement custom jobs using the new job framework without having to use pipelines and pipelets. We have concluded our multi-release effort (19.7–19.10 Releases) to provide JavaScript or job-step replacements for all functionality previously available only as 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.

  • DownloadActiveDataFromStorage
  • 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)
  • UploadActiveDataToStorage

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 NavigationCatalog.xml, the archived file is something like JobID_StepID_20191224_062213546_NavigationCatalog.xml.

Resources