cancel
Showing results for 
Search instead for 
Did you mean: 

How to access the categories of a product in cpq with python

inbe2812
Discoverer
0 Kudos

I like to read out the categories to which a product is assigned.

Could only retrieve single one category on product.

Is there a was to geh all categories of a product?

Thanks

 

View Entire Topic
Fancy_Zou
Product and Topic Expert
Product and Topic Expert

Hello,

There are multiple ways to get the category to which a product is assigned, depending on the specific business requirements:

1. At the quote item level, after a product is added to the quote, the category to which the product is added can be retrieved. For example, if a product is assigned to both category A and category B, but the user adds/configures the product from category A, the category at the quote item level will be A.

  • IronPython: QuoteItem.CategoryId
  • Tag: <*CTX( Quote.CurrentItem.ProductInfo.CategoryId )*>

2. At the product master level, you can access all the categories to which the product is assigned.

3. On the Configurator, the displayed path at the top indicates the category from which the product is being configured. This information can be accessed through the Responsive Template.

4. Within the Product Catalog, the information of the displayed category can also be accessed through cpq.models.catalog using the Responsive Template.

Best Regards

Fancy