Configure dynamic pricing

Leave how to configure dynamic procing.

Configuring dynamic pricing involves setting up your Salesforce Commerce Cloud (SFCC) to offer prices that adapt based on the customer’s location and chosen currency. This feature enhances the shopping experience by ensuring relevant and competitive prices, accounting for different tax rates and currency conversions. The following sections will guide you through enabling and fine-tuning dynamic pricing to meet your business needs.

Dynamic pricing best practices

Keep in mind the following when configuring and enabling dynamic pricing installation:

  • With dynamic pricing enabled, the merchant must use the country selected from the country and currency menu as the shipping country in checkout, and the customer cannot change the shipping country.

Important: The merchant needs to provide customization to enforce this requirement.

  • Dynamic pricing jobs do not convert amount-based promotions. To use amount-based promotions, create them in the desired amounts per currency.

  • Since dynamic pricing uses a job to convert prices, the base price book does not reflect changes in real-time. Updated prices are converted the next time the scheduled job runs.

  • The dynamic pricing job for Product Options updates prices on a per-catalog basis. If the catalog is shared between sites with different taxation structures (net/gross) for the same currency, one of the sites will have inaccurate prices. The taxation structure (net/gross) configured on the Digital River-side will determine the correct prices for a given country/currency combination.

  • The dynamic pricing job for Product Options updates prices on a per-catalog basis; if multiple countries using the same currency are configured, some of the countries may get incorrect prices. This is due to the SFCC limitation that product options are stored in the catalog (not the price book) and can only store prices per currency, not per currency/country combinations. By default, the connector uses the first applicable country/currency combination for each currency as configured in Business Manager in the Configure Supported Country Currency Pairs module. See the Configure supported Country and Currency pairs section of the User Guide section for more details.

Configuring dynamic pricing

Complete the following steps to configure dynamic pricing:

1. Configure site and global configuration options

When using dynamic pricing, you can choose multiple configuration options. To set these options, do the following:

  1. Select BM Merchant Tools and select Site Preferences.

  2. Select Custom Preferences to see Custom Site Preferences Groups.

  3. Click Digital River to see the cartridge setup fields.

  4. Provide the following preference information at the site level when using dynamic pricing.

    • Digital River Enable Dynamic Pricing: Enable or Disable the dynamic pricing feature.

    • Digital River Shipping Method Availability: Select one of the following:

      • Native SFCC methods only (native): Choose this option to turn off the Digital River Shipping Options feature

      • DR Shipping Quotes methods only (quotes): Choose this option to display only Digital River Shipping Options

      • Native SFCC and DR Shipping Quotes methods (both): Choose this option to display both Digital River shipping options and native SFCC shipping methods.

      • Digital River List Converted Price Book Naming: Provide the naming pattern of list price books generated by the dynamic pricing job. The naming convention must contain the {COUNTRY} and {CURRENCY} placeholder tokens; otherwise, dynamic pricing will not create the price books.

      • Digital River Sale Converted Price Book Naming: Provide the naming pattern of sale price books generated by the dynamic pricing job. The naming convention must contain the {COUNTRY} and {CURRENCY} placeholder tokens; otherwise, the price books will not be generated.

      • Digital River Batch Size: Specify the number of items to send in the Dynamic Pricing API call. The default number is 50. However, this setting has been tested against batches of 500 and 1000 or more. You should test and optimize the batch size based on the resource allocation of the SFCC instance.

  5. Provide the following global-level preference information:

    • Digital River Base Currency Code: This code instructs the DigitalRiver_DynamicPricing_ProductOptions job about which of the existing currencies will be used as the base currency for product option conversion.

2. Enable all currencies

Merchants must enable all required currencies on the site(s) to use the dynamic pricing feature. In addition, they should add the locale and currency combinations to the alternativeCurrencyCodes property in thecountries.json file for your site(s). The countries.json file must be present on the cartridge path for both the storefront(s) and the Business Manager. You cannot configure country currency pairs if this file is absent.

3. Configure Supported Country Currency Pairs business manager module

In addition to custom site preferences, you can configure dynamic pricing with an additional method in the form of a Business Manager (BM) Module extension. Use this extension to let the merchant configure country and currency mapping. Dynamic pricing jobs use this mapping to generate prices and to create the country and currency selection form on the storefront. The information is saved in a hidden site preference as JSON. See the Merchant Tools section of the User Guide for more details on using this module.

Tip: Before using the Dynamic Pricing feature, you must configure supported country currencies and run the Dynamic Pricing job to generate the price books.

4. Configure the Dynamic Pricing jobs

Refer to the Configure jobs section for information on configuring dynamic pricing jobs.

5. Add the country currency selector modal to your storefront in the desired location.

Add the country currency selector modal to your storefront in the desired location. Follow the instructions in this document's Menu template and Page Header template sections.

Note: The cartridge does not automatically override these templates so it must be added in the desired location. Alternatively, you can create a custom selector instead of using the country currency selector provided in the cartridge.

Configure jobs

Configuring jobs is essential for maintaining accurate and efficient pricing across your storefront. In this section, you will learn how to set up and manage dynamic pricing jobs to ensure that your products are priced correctly in various currencies, aligning with the target markets specified in your configuration.

You can use two different jobs for price conversion with dynamic pricing:

  • DigitalRiver_DynamicPricing: Converts price books

  • DigitalRiver_DynamicPricing_ProductOptions: Converts catalog product options.

Use DigitalRiver_DynamicPricing

Use this job to convert a base list price book and a base sale price book in the base currency to target currencies as configured in the Supported Country Currency Pairs module.

The job is made up of several flows that include the following:

Flow 1

Scope: Organization

This flow exports the price books and uses the SFCC built-in ExportPriceBook. You must configure two parallel steps for both the list price book and the sale price book.

Set the following configuration parameters for this job step:

  • ID: Specify a unique job step ID. Provide any value, but it's best to describe the actual job action. For example, ExportListPriceBook and ExportSalePriceBook.

  • Description: Provide additional information that describes the job step. This field is optional.

  • PriceBookID: Specify the ID of the list base price book (ExportLIstPriceBook step) and sale price book (ExportSalePriceBook step). This field is required.

Note: You must update this parameter with the ID(s) of your price book(s).

  • ExportFile: Specify the path and name of the exported file relative to IMPEX/src. If you change the default value, update the corresponding value in the ProcessPriceBooks step. This field is required.

  • FileNamePrefix: Leave this blank. This field is optional.

  • OverwriteExportFile: Enable this setting. When enabled, this action overrides a file with the same name if it exists.

  • Always execute on restart: Leave this setting disabled, as it controls behavior when restarting this job.

Flow 2

Scope: Site

This flow processes the exported price books and generates new dynamic pricing for the price books. There are two ways to configure this flow:

  • Single-step: With this configuration, you can generate all the price books for country and currency pairs. Set the scope to include all sites using the dynamic pricing feature.

  • Parallel steps (2 versions):

    • Parallel steps (country-based): Each step generates the price books of 1 country. You must configure the country parameter to use this method and configure one step for processing each country. You may be required to set up multiple flows to support all desired countries.

    • Parallel steps (site-based): If you have multiple sites in your instance, configure parallel steps with each scope set to a single site. Configure a step per site.

Note: By default, the job is configured with a single step for this flow. Modify the job to support various configurations as just described.

Note: Based on your environment, choose whether to use single or parallel steps. Test your environments to determine which setup optimizes the performance of your price book conversions. While parallel processing has many benefits, your instance is constrained by its resource allocation and can only use the available resources when running parallel steps.

This flow uses Custom.DigitalRiverProcessPriceBooks custom job step. Set the following configuration parameters for this job step:

  • ID: Specify a unique job step ID. Provide any value, but describing the actual job action is best. For example, ProcessPriceBooks or ProcessPriceBooksUS.

  • Description: Provide additional information that describes the job step. This field is optional.

  • BaseListPriceBookPath: Specify the path and name configured in the previous flow for the List Price book.

  • BaseSalePriceBookPath: Specify the path and name configured in the previous flow for the Sale Price book.

  • DynamicPricingExportFolder: Specify the path of the generated files relative toIMPEX/srcwhere the files are stored. This field is required.

  • CountryCode: Specify the country code belonging to the country to be processed. This field is required if this flow uses the parallel steps configuration (country-based). Otherwise, leave it empty.

  • Always execute on restart: Leave this setting disabled as it controls behavior on restarting this job.

Flow 3

Scope: Organization

This flow imports the price books generated by Flow 2 and makes use of the SFCC built-in ImportPriceBookjob step.

Set the following configuration parameters for this job step:

  • ID: Specify a unique job step ID. Provide any value, but describing the actual job action is best. For example, ImportPricebooks.

  • Description: Provide additional information that describes the job step. This field is optional.

  • WorkingFolder: Specify the path of the generated files relative toIMPEX/srcwhere the files are stored. This field is required.

  • FileNamePattern: Leave this field empty.

  • NoFilesFoundHandling: Set this to NO_FILES_FOULD

  • ImportMode: Set to merge. This field is required.

  • ImportFailedHandling; Set to warn. This field is required.

  • AfterImportFileHandling – Set to archive. This field is required.

  • ArchiveFolder - Set to archive. This field is required.

  • Always execute on restart: Leave this setting disabled as it controls behavior on restarting this job.

Flow 4

Scope: All sites

This flow provides reindexing and is required for a new process to be correctly displayed. This flow makes use of the SFCC built-in ReindexProducts.

Set the following configuration parameters for this job step:

  • ID: Specify a unique job step ID. Provide any value, but describing the actual job action is best. For example, ReindexProducts.

  • Description: Provide additional information that describes the job step. This field is optional.

  • Product-related search indexes: Enable this field as it causes the product index to update. It is a required field.

  • Active data search index, Content search index: Leave this disabled.

  • Indexer Type: Specify the type of reindexing. The incremental choice is faster. However, a full index can resolve indexing issues. The merchant decides the setting for this field.

  • Always execute on restart: Leave this setting disabled as it controls behavior when restarting this job.

Examples of single-step and parallel steps configurations

The following examples show screenshots of the single-step and parallel steps flow configurations used to export price books and generate new dynamic pricing price books.

This example shows a single-step configuration used to process all currencies:

This example shows a parallel steps configuration used to process different currencies:

Use DigitalRiver_DynamicPricing_ProductOptions

Use this job to convert product options in the catalog(s) that use the configured base currency to the target currencies. Note: This job only supports a single price per currency, not country currency pairs. It is an SFCC limitation.

The job is made up of several flows that include the following:

Flow 1

Scope: Organization

This flow exports the catalog and makes use of the SFCC built-in ExportCatalog. Configure multiple parallel steps if multiple catalogs are to be updated.

Set the following configuration parameters for this job step:

  • ID: Specify a unique job step ID. Provide any value, but describing the actual job action is best. For example, ExportElectronics-m-catalog.

  • Description: Provide additional information that describes the job step. This field is optional.

  • CatalogID: Specify the ID of the catalog you are exporting. This field is required.

Note: You must update this parameter with the ID(s) of your catalog(s).

  • ExportProductOptions: Make sure this is Enabled. It causes the export of product options. This field is required.

  • ExportCategories, ExportCategoryAssignments, ExportProducts, ExportRecommendations, ExportVariationAttributes: Leave these disabled.

  • ExportFile: Specify the path and name of the exported file relative to IMPEX/src If you change the default value, update the corresponding value in the ProcessProductOptions step. This is a required field.

  • FileNamePrefix: Leave this blank. This is an optional field.

  • OverwriteExportFile: Make sure this is enabled. If a file with the same name exists, it will overwrite it.

  • Always execute on restart: Leave this setting disabled as it controls behavior on restarting this job.

Flow 2

Scope: Organization

This flow processes the export catalogs and generates the new catalog. You can configure multiple parallel steps if multiple catalogs need to be updated. The flow makes use of the custom job step Custom.DigitalRiverProcessProductOptions.

Set the following configuration parameters for this job step:

  • ID: Specify a unique job step ID. Provide any value, but describing the actual job action is best. For example, ProcessProductOptionsElectronics-m-catalog.

  • Description: Provide additional information that describes the job step. This field is optional.

  • BaseCatalogPath: Specify the path and name of the exported file relative to IMPEX/src. This should match the path configured in the previous flow. This field is required.

  • ExportFolderPath: Specify the path of the new catalog relative to IMPEX/src. If you change the default value, be sure to update the corresponding value in the ImportCatalog step. This field is required.

Flow 3

Scope: Organization

This flow is responsible for importing the price books generated by Flow 2 and uses the SFCC built-in ImportCatalog.

Set the following configuration parameters for this job step:

  • ID: Specify a unique job step ID. Provide any value but it's best to describe the actual job action. For exam,ple, ImportCatalogs

  • Description: Provide additional information that describes the job step. This field is optional.

  • WorkingFolder: Specify the path of the generated files relative to IMPEX/src where the files are stored. This should match the path configured in the previous flow. This field is required.

  • FileNamePattern: Leave this field empty.

  • NoFilesFoundHandling: Set to NO_FILES_FOULD

  • ImportMode: Set to merge. This is a required field.

  • ImportFailedHandling: Set to warn. This is a required field.

  • AfterImportFileHandling: Set to archive. This is a required field.ArchiveFolder: Set to archive. This is a required field.

  • Always execute on restart: Leave this setting disabled as it controls behavior when restarting this job.

Flow 4

Scope: All sites

This flow reindexes and requires a new process to be displayed correctly. It uses the SFCC built-in ReindexProducts.

Set the following configuration parameters for this job step:

  • ID: Specify a unique job step ID. Provide any value, but describing the actual job action is best. For example, ReindexProducts.

  • Description: Provide additional information that describes the job step. This field is optional.

  • Product-related search indexes: Enable this field as it causes the product index to update. It is a required field.

  • Active data search index, Content search index: Leave this disabled.

  • Indexer Type: Specify the type of reindexing. The incremental choice is faster. However, a complete index can resolve indexing issues. The merchant decides the setting for this field.

  • Always execute on restart: Leave this setting disabled, as it controls behavior when restarting this job.

Example of a DigitalRiver_DynamicPricing_ProductOptions configuration

The following shows an example of a DigitalRiver_DynamicPricing_ProductOptions configuration:

You can schedule all jobs to whatever frequency the merchant wishes. Be careful not to overlap running jobs with each other or with themselves. A full reindex may take significant time, depending on the number of products. Jobs first check for configuration prerequisites and will fail with an error if these are not met.

Dynamic pricing and storefront functionality

Dynamic pricing and storefront functionality allow merchants to provide localized pricing to shoppers based on their country and currency preferences. It ensures customers see prices relevant to their location, improving the shopping experience and potentially increasing conversion rates. By integrating a country and currency selection modal into the storefront, merchants can dynamically switch price books and present accurate pricing information tailored to the user's geographic region.

You must add this selector to the storefront using the Menu template and Page Header. Dynamic pricing uses the following controller endpoints:

  • DigitalRiver-CountryCurrencySelector: Retrieves information about the selector.

  • DigitalRiver-SelectCountryCurrency: Sets the selected country currency and switches price books.

You can customize the selector's user interface by using the endpoint correctly. The expected parameters for setting the country and currency are country and currency.

Extending the Country/Currency Selector

You can use a custom country currency selector instead of using the one provided by the cartridge. Make your user interface call the DigitalRiver-SelectCountryCurrency controller the same way the .js script provided in the cartridge does.

You can find an example in the cartridge's drDynamicPricingSelector.js script. For example:

Pass the following parameters into the Ajax call

  • country: Set to the shopper-selected country that dynamic pricing will use.

  • currency: Set to the shopper-selected currency that dynamic pricing will use.

  • action: Use as a passthrough as part of the redirect URL.

  • queryString: Use as a passthrough as part of the redirect URL.

Last updated