L8 - The most preformant way to check what campaigns a variant is attached to?

Hi, we want to display badges, “3 for 2” or “Free gift”, “etc” on product cards/pages if the products are part of those campaigns. So my question is:

Given a VariantSystemId and channel Channel. What is the best way in Litium 8 to:

A: Find all campaigns that is this variant is attached two

OR

B: Geven a CampaignSystemId what is the most preformant way to check if a variant is part of that camapign?

Thanks

Litium version: 8

If you try to get this information each time when you are showing a list of products (for ex: search result page or category page) you will have performance issues. An approach can be to create a cache with product and campaigns but it can also cause performance issues if you are using dynamic product lists for campaigns and your products are updated frequently.

If you are using campaign price lists for campaigns then you can get all the products in campaigns via those price lists for example.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.