Fetch campaing type

Is it possible to fetch the campaign type from a campaign?

Litium.Foundation.Modules.ECommerce.Campaigns.Campaign.CampaignType is obsolete and refers to using action connected to the campaign. But I can’t find any data regarding the campaign type on the action:

what I need to see is if it is an order-campaign or a product-campaign.
In the Data-object on the action there is SelectedIDs, would that work if I just check if it exists or not?
Or is there a better solution for this?

Litium version: [7.4.2]

Try this instead:

Litium.Foundation.Modules.ECommerce.Campaigns.CampaignAction.ActionType
or
Litium.Foundation.Modules.ECommerce.Campaigns.CampaignActionInfo.TypeName

Try with Litium.Foundation.Modules.ECommerce.ModuleECommerce.Instance.Campaigns.GetCampaign(default, default).ActionInfo.GetActionType() (remember to replace default with the correct values).

It works with GetActiontype() but it’s returning Cart as type for all these 3 kind of campaigns:
image
Shouldn’t at least “Buy X of the same product, pay for Y” be a product-campaign?

No, since it looks on the contents of the cart for that one. Does the cart contain X of product.

yeah the check is on cart but the campaign applies on a specific product/orderrow.
So when will a campaign be a product-campaign type?

In general, if the action is dependent on the whole content of the cart it’s an Cart (or Order) level campaign.

So for the standard campaigns in Litium:

Product - Set a campaign product price
Product - Reduce product price by percentage
Order - Reduce order value by percentage
Order - Reduce order value by amount
Order - Buy any X products, get discount on the cheapest
Order - Buy X of the same product, pay for Y
Order - Free gift
Fee - Free fee
Delivery - Free shipping
Delivery - Free shipping for delivery methods

1 Like