Try our conversational search powered by Generative AI!

Commerce Promotions - shipping build your own discount does not evaluate associated campaign's assigned target segments

Found in

EPiServer.Commerce.Core 8.13.3

Created

Jun 24, 2015

Updated

Jul 24, 2015

Area

Falcon/Commerce/eCommerce Framework

State

Closed, Fixed and Tested


Steps to reproduce

Steps to reproduce:

  1. Do the following in Commerce Manager.
  2. In Marketing > Customer Segments, create a new segment.
  3. Set "Segment Name", "Display Name", and "Description" to "SegmentMainlandUSA".
  4. Click "New Condition", in the dialog set "Expression Name" to "ExpressionMainlandUSA".
  5. Setup the "Expression Xml" field like shown in (see attached) ExpressionMainlandUSA.png.
  6. In Marketing > Campaigns, create a new campaign and name it FreeShippingCampaign.
  7. Set up the campaign like shown in (see attached) FreeShippingCampaign.png.
  8. In Marketing > Promotions, create a new promotion of type "Shipping: Build Your Own Discount" and name it "Shipping Test".
  9. Associate the shipping promotion with FreeShippingCampaign and set it up like shown in (see attached) FreeShippingPromotion1.png and FreeShippingPromotion2.png
  10. In Order Management, create a new order, I use Default Market w/ US dollar as currency.
  11. Add a new item with a price over $50 to trigger the shipping promotion.
  12. Add a billing and shipping address whose Country Name field is not United States.
  13. Under "Shipment Details", select Ground Shipping and hit Recalculate.
Expected:

Under "Order Summary", the "Less Shipment Discount" field should not be updated with a discount value equal to the "Shipping Cost" field.
There should be no discount as the ExpressionMainlandUSA condition associated with the campaign of the shipping promotion we created should disqualify this promotion.

Actual:


Under "Order Summary", the "Less Shipment Discount" field displays a discount value that matches the "Shipping Cost" field.
The promotion is qualified and creates a shipping discount for the order.
Clicking OK and completing the order also shows that the shipping discount is applied.

In this case the ExpressionMainlandUSA condition is simplified to only take country into account, but the intended use is to exclude the Alaska, Hawaii, and Puerto Rico states as well. 
However, testing this level of complexity was not possible as we found that the country was not even taken into account.

Did some decompilation in Mediachase.Commerce.Marketing.MarketingContext, Mediachase.Commerce, Version=8.13.3.727 to check GetCustomerSegments().
There must be something in the way the SegmentConditionRow is being validated that is allowing orders with non qualifying country addresses to pass.