Doofinder logo

Support Documentation

Search icon

Configure Currencies With Multiprice Attribute

Multiprice

Doofinder's multiprice attribute allows you to handle multiple currencies within a single Search Engine, simplifying operations and enhancing flexibility, enabling a more streamlined and efficient approach to managing multiple currencies and price configurations across regions.

This enhancement introduces the df_multiprice field in the index.

The df_multiprice attribute is an object containing keys that represent different price labels (such as currencies or pricing tiers). These labels are accessed dynamically through the price_name parameter in search requests, ensuring flexibility and control.

Language and Currencies with Multiprice

With multiprice attribute, you can manage multiple currencies and prices within a unique Search Engine for a language, and a specific attribute to deal with currencies.

For example, you will create just 1 Search Engine for these language and currencies combinations:

  • EN/EUR-USD-GBP - 1 Search Engine

Language and Currencies without Multiprice

With no multiprice attribute, you have in your store a unique search engine for each language and currency combination.

For example, you will create a total of 3 Search Engines for these language and currencies combinations:

  • EN/EUR - 1 Search Engine
  • EN/USD - 1 Search Engine
  • EN/GBP - 1 Search Engine

The selection of search engines in the Live Layer is determined based on the following criteria:

  • Language: defined by the lang attribute in the HTML tag of the page, or an explicitly provided option in the layer configuration.
  • Currency: optionally specified in the layer configuration for cases where the language code does not match any available search engine.

If you can’t configure the df_multiprice attribute and need a unique Search Engine for each language and currency combination, refer to the following article.

Benefits of the Multiprice Attribute

By using the multiprice attribute you will:

  • Manage multiple currencies within a single Search Engine, minimizing the number of Search Engines needed for a language.
  • Reduce the complexity of maintaining separate feeds for languages with different currencies.
  • Dynamically control pricing attributes for diverse contexts, including sales and promotions.
  • Reduce the number of requests to our servers.

Example of the Multiprice Attribute

The df_multiprice object allows you to define price values for multiple currencies or pricing structures.

To use it, you will need to use the price_name attribute. This attribute allows you to define a custom identifier for the price field, allowing flexibility in referencing pricing data according to your naming conventions. As shown in the examples below:

Structure example:

{
  "df_multiprice": {
    "price_name": {"price": 10, "sale_price": 6, "best_price": 6},
    "price_name": {"price": 9000, "sale_price": 5000, "best_price": 5000},
    "price_name": {"price": 10000, "sale_price": 5000, "best_price": 5000}
  }
}

Example using currencies:

{
  "df_multiprice": {
    "EUR": {"price": 10, "sale_price": 6, "best_price": 6},
    "USD": {"price": 9000, "sale_price": 5000, "best_price": 5000},
    "GBP": {"price": 10000, "sale_price": 5000, "best_price": 5000}
  }
}

This approach contains all pricing information for a specific language in a single field, simplifying price management across multiple regions and currencies.

Take a look at a TXT index example with multiprice:

id|title|link|df_multiprice
1 | Hummingbird printed t-shirt | https://www.doofinder.com/es/men/1-hummingbird-printed-t-shirt | price_name_price=24.0/price_name_sale_price=19.2/price_name_price=19.9/price_name_sale_price=15.9

How to Configure the Multiprice Attribute

Here is a step-by-step guide on how to configure your feed to benefit from this attribute.

1. Prepare Your Data Feed

Add the df_multiprice field to your data feed. This field should include price values under different namings, formatted as an object with corresponding prices that will be later linked to a currency.

Example:

 {
  "df_multiprice": {
    "EUR": {"price": 26, "sale_price": 21},
    "USD": {"price": 24, "sale_price": 19},
    "GBP": {"price": 26, "sale_price": 21}
   }
 }

2. Index Your Feed

To be able to use these values, index your feed in Configuration > Indices.

3. Place the price_name Parameter in Your Script

Now, you will need to place the price_name parameter in your HTML's Doofinder script.

This parameter will tell Doofinder which are the different currencies and prices configured under a language in your Search Engine.

Ensure that the different values match the end-user’s region. For example, if the user is viewing the page in Europe, the script should be configured as follows:

 <script>
  (function(w, k) {w[k] = window[k] || function () { (window[k].q = window[k].q || []).push(arguments) }})(window, "doofinderApp")
  doofinderApp("config", "language", "en")
  doofinderApp("config", "priceName", "price_name")
 </script>
 <script src="https://eu1-config.doofinder.com/2.x/50ff970f-8f03-41f9-8203-0f9767f6ab99.js" async></script>

The script will now send the price_name to the layer.

4. Configure Currencies in the Admin Panel

In your Admin Panel, go to Configuration > Store Search Engines > click on the name of the Search Engine where there are the different pricing for user groups. You will be now on the Search Engine Setup panel.

Search Engine Setup Multicurrency configuration

If you have created the df_multiprice attribute correctly in your feed, by adding the language and currency, all the price_name you have configured will be automatically mapped.

Once finished, click on “save”.

5. Publish the Search Engine

After testing and configuring the features of your choice, go back to Search Engine Setup. Enable the switch on the right-corner of the Admin Panel and click “Publish” on the pop-up window.

You will now enjoy of a unique and unified Search Engine with multiple currencies and prices under a language.

Search engines without multiprice functionality and those with multiprice capability can coexist across different search engines.

Did you find this page helpful?