Troubleshooting campaigns
Sometimes a misconfigured campaign will not get applied. The campaign looks as if it is "not working" and is not behaving as it is supposed to be. Here are some troubleshooting tips to rectify the most common problems.
Follow these steps to verify a campaign:
- Observe the order grand total when a campaign supposed to be applied. If it does get reduced, then the campaign might be applied, but your web page is not showing the campaign price or the order discounts.
- Is the campaign active?
In back office, Sales > Campaigns, and check whether the campaign is active.
- Is the campaign validity period correct?
In back office, Sales > Campaigns, and check the start and end dates of the campaign.
- Is the campaign currency correct?
Check whether your shopping cart currency matches the campaign currency.
- Is the campaign website correct?
Check whether your shopping cart website is same as the intended website in the campaign. Also see the section "Verifying the order carrier website id" below.
- Does a campaign condition cause the problem?
Remove all conditions from your campaign and see whether it gets applied. If the problem is caused by a condition, check why the condition is not fulfilled. If its a voucher code condition, check whether the voucher code is applied to the CurrentState.Current.OrderCarrier.CampaignCode property and whether the order grand total is re-calculated after that.
- Is the campaign in conflict with another campaign that has higher priority?
Deactivate all other campaigns, and check whether the campaign is applied. If it is applied, check if the campaign can be combined with other campaigns.
Voucher code is not automatically removed
If you have a voucher code condition for your campaign and set a frequency for the voucher codes, each time a successful order is placed the voucher codes should be removed automatically (or its frequency decreased by one) so that the same voucher code cannot be used again.
If this does not seem to work, you should check your state transitions implementation to see whether your order confirmation state has an entry action, which calls the ModuleECommerce.Instance.CampaignCalculator.HandleOrderConfirmation() method.
The following is an example from the Litium accelerator implementation:

Verifying the order carrier website id
If you have multiple websites and move from one website to another, the CurrentState.Current.OrderCarrier website id is not changed automatically.
The following code needs to be placed in the .master file page load to always have the correct currency and the website id in the shopping cart order carrier.
if (CurrentState.WebSite.Currency.CurrencyCode != CurrentState.Current.ShoppingCart.Currency.CurrencyCode)
CurrentState.Current.ShoppingCart.SetCurrency(CurrentState.WebSite.Currency.ID);
if (CurrentState.Current.WebSiteID != CurrentState.Current.ShoppingCart.OrderCarrier.WebSiteID)
CurrentState.Current.ShoppingCart.SetWebsite(CurrentState.Current.WebSiteID, ModuleCMS.Instance.AdminToken);