d
Topic
Jordan API Product / Developer Experience
Posts:
272
July 17, 2017

Changes to how discounts are displayed in Shopify admin This post is outdated

Currently, the Shopify discounts admin page displays discount codes (i.e discount_code.code) like so:

 

However, as of August 7th, 2017 Shopify will display the price_rule.title value in the admin. Please take this change into consideration if you have an app that creates or modifies price rules. 

If you have any questions or need further clarification, don't hesitate to comment in the thread below. 

 

 

Happy coding,


Jordan L
Developer Experience
Shopify
 

i
Replies
Ryan Alyea Shopify Partner rofish.net
Posts:
26
Last edited July 17, 2017

How will this affect the order['discount_codes'] array in the JSON? Or is there no change planned?

As of right now customers with a very specific discount on specific items only show as a total discount amount both in the admin and on the JSON. It currently does NOT update line_items.total_discounts, which is used for Shopify Scripts and Shopify POS, leading to two different ways discounts are presented in the API.

My ideal, coming from an accounting perspective who is _really_ interested in knowing what discount applied to what item, is to have the line_item.total_discount reflect the amount taken off. Bonus of order.discount_codes is something like {code:#{code},amount:#{amount},rule:#{rule},each_line_item:{#{line_item.id}:#{amount_taken_off_this_item_for_this_code}}

The above could work for Shopify Scripts (which the code/rule could be the script and Scripts already works on a per_line_item basis) and Shopify POS (code/rule would both just be "pos" as the discount because it came from manually typing.)

In short, trying to keep everything presented the same way is good and more data is always ideal for everyone.

Jordan API Product / Developer Experience
Posts:
272
July 18, 2017

How will this affect the order['discount_codes'] array in the JSON? Or is there no change planned?

Hey Ryan , this is a just a UI concern, so no affect to the order.discount_codes array.