Assign a Price Book or Promotion to a Specific Store

With Store-Specific Pricing and Promotions, you can select a price book for each of your stores, up to 2,000. The assignments framework lets merchants and developers set qualifiers, such as a store, that activate certain experiences, such as a promotion. You can also assign a promotion to a specific store. This feature is currently only supported via XML import. To use a site assignment, a developer must first edit the assignments XML to include a store assignment. Currently only stores can be listed as assignments.

  1. Select site > Merchant Tools > Online Marketing > Import & Export.
  2. Click Import in the Assignments section.
  3. Select the file with your assignments and click Next.
  4. Consider the following sample code for assignments.
    <?xml version="1.0" encoding="UTF-8"?>
    <assignments xmlns="http://www.demandware.com/xml/impex/assignment/2020-11-30">
        <assignment assignment-id="Storeassignment_A">
            <description xml:lang="x-default">Price books and promotions assigned to Store A</description>
            <description xml:lang="zh-CN">万能青年旅店</description>
            <enabled-flag>true</enabled-flag>
            <start-date>2020-11-24T00:00:00.000Z</start-date>
            <end-date>2025-11-24T00:00:00.000Z</end-date>
            <assigned-sites>
                <site>SiteGenesis</site>
                <site>SiteGenesisGlobal</site>
            </assigned-sites>
            <qualifiers match-mode="any">
                <qualifier type="Store">Store A</qualifier>
            </qualifiers>
            <experiences>
                <pricebooks>
                    <pricebook-id>list_pricebook</pricebook-id>
                    <pricebook-id>sale_pricebook</pricebook-id>
                </pricebooks>
                <promotions>
                    <promotion-id>20%Off_promotion</promotion-id>
                </promotions>
            </experiences>
        </assignment>
    ​
    </assignments>
You can see the status of your file. Hit refresh until the import concludes. The import can take a few minutes.
To display store-specific experiences on the storefront, a developer must update their SFRA cartridge or write an OCAPI hook to set the store in session.