solidusio-contrib / solidus_tracking

Data tracking extension for your Solidus store.
BSD 3-Clause "New" or "Revised" License
4 stars 10 forks source link

Update order serializer to handle promotions correctly #17

Closed seand7565 closed 3 years ago

seand7565 commented 3 years ago

Previously, the order serializer would pull in all promotions regardless of whether they were eligible or not and display the promotion_code. This also causes breakage with order promotions that apply to all orders, as those promotions do not have promotion_codes.

This only displays eligible promotions in the serializer, and if no promotion code exists, will set the promotion code to "all orders".

aldesantis commented 3 years ago

@seand7565 can we also add a test that ensures non-eligible promotions are not included?

seand7565 commented 3 years ago

@aldesantis Added! Let me know how it looks. 😄