Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Product Recommendation API is a feature of Pricefx Core, which allows a user to add to a Quote some products from list of recommended products. This list is:

  • available via special button Add Recommended Products found on Quote Items page

  • produced by a Model in Optimization module.

Note: This specific core API solves only the special Add button on Quote Item page. If you need to implement the list of recommended products on the quote item, you will do it in the quote item logic, for example, by reading data from the Model (via the same Evaluation logic), or from Product Extension, or so.

Architecture

product recommendation api.drawio

Configuration

Configuration of the Product Recommendation feature for Quotes is stored in Advanced Configuration Option quoteProductRecommendationsConfig.

This property stores the link to the model with Product Recommendation data.

Example of Product Recommendation configuration in Advanced Configuration Option quoteProductRecommendationsConfig
{
  "recommendationsEnabled": true,
  "modelName": "CrossSellModel",
  "evaluationName": "ProductRecommendation_Eval",
  "elementName": "ProductRecommendation",
  "allowDuplicates": false,
  "categories": [
    {
      "categoryName": "customer",
      "defaultMaxResults": 10,
      "enabled": true
    },
    {
      "categoryName": "productHistory",
      "defaultMaxResults": 5,
      "enabled": true
    },
    {
      "categoryName": "customerSegment",
      "defaultMaxResults": 5,
      "enabled": true
    }
  ]
}

JSON Schema of quoteProductRecommendationsConfig

  • recommendationsEnabled* - (boolean) When true, Product Recommendation is switched ON for all Quote Types. By default false.

  • modelName* - (text) Unique name of the Model, from which the product recommendation data should be read. When evaluationName is set, the modelName is expected to be name of Model based on Model Class. When evaluationName is not set, the modelName is treated as name of Model of type Model Type.

  • evaluationName - (text) Unique name of Model’s Evaluation, which will be used to retrieve the data about recommendations. Use only when reading data from Model based on Model Class. When this value is not set, it’s an indication, that modelName refers to ModelType and not ModelClass.

  • elementName - (text) Name of the evaluation logic element, which provides the list of recommended products. Only for Model of type Model Class. See Model Evaluation Logic.

  • allowDuplicates - (boolean) Used by the endpoint (e.g. Quotes screen) to avoid the same product to appear as a result for different recommendation categories. The recommendation endpoint evaluates the recommendation model several times: one time for each category. As each recommendation categories may return the same product, the allowDuplicates is used by the endpoint to avoid or not a same product to appear as a result for different recommendation categories. By default false.

  • categories* - (list of objects) Recommendation categories are there to distinguish different source of recommendation, like recommendation based on product similarity, or recommendation based on clients similarity (this product is recommended as other clients buying one product buys also this other product). The recommendation endpoint evaluates the recommendation model several times: one time for each category. Each category has following properties:

    • categoryName* - (text) Name of the category. Must be unique within the list of categories. The category name will be passed to the evaluation logic. Examples: "customer", "customerSegment", "productHistory", "productRelations".

    • enabled* - (boolean) If this category is enabled.

    • defaultMaxResults - (integer) If the evaluation logic returns for given category more than #defaultMaxResults recommendations items, the list will be shorted by the system to the defaultMaxResults size.

    • allowDuplicates - (boolean) Deprecated. It is here only for backwards compatibility. See allowDuplicates on the root level for description. If the allowDuplicates is set on the root level, then this value will be ignored.

Internationalization

When the names of the categories show up on the screen, they’re translated via specific translation keys:

Category Name Translation Key

customer

unity_qm_items_recommended_category_customer

customerSegment

unity_qm_items_recommended_category_customer_segment

productHistory

unity_qm_items_recommended_category_product_history

productRelations

unity_qm_items_recommended_category_product_relations

  • No labels