ProductPriceModelBuilder wont return a campaign price

What is required for ProductPriceModelBuilder to return a campaign price? What kind of campaigns will trigger the campaignprice on the model?

Im calling the builder via:
var priceModel = _productPriceModelBuilder.Build(variant, website.Currency.ProxyFor, website).

priceModel.CampaignPrice is always null even tho i try sending in different variants with different kind of campaigns active on each variant

Litium version: 6.2

1 Like

Are the variants published to the website? And are the campaigns active?

yes they are. I now test with applying a campaign to entire assortment and fetched all products and looked if any of them had a value for campaignprice after building the model, still null for every variant.
You neglected to answer the second question which was “What kind of campaigns will trigger the campaignprice on the model?”

It’s only product campaigns that will affect prices for the individual products and product campaigns are not applied if the product have tier prices.

I only have one campaign active and its of type “lower product price with %” , so that should work then?

image

Yes. That campaign should work if the product not have tier prices.

then why is _productPriceModelBuilder.Build(variant, website.Currency.ProxyFor, website).CampaignPrice null ?

It’s very hard to know the correct answer on that from the information in this forum thread.

How is the website configured?
How is the campaign configured (all three tabs)?
How is the price and price lists configured?

i sent you a screenshot on slack of our configuration.

Are the price imported with ‘0’ or ‘1’ as minimum quantity?

we import them with min quantity 1

image

There we have the problem, when using minimum quantity as something else than 0 (zero) the campaign engine will treat the variant to have tier prices (even that only one price exists) and will not execute product campaigns for them.

Please read more about minimum quantity on https://docs.litium.com/documentation/litium-documentation/products/price-lists-and-calculations#minimum-quantity

1 Like

that solved the problem, thank you!