Commit Graph

4 Commits

Author SHA1 Message Date
vedanshujain aaa85ac74c Use standard way to calculate total in `get_subtotal_to_display` for consistency.
We were calculating subtotal to display slightly differently then we would have calculated subtotal in the cart. This was affecting subtotal value in invoices and in order confirmation screen.

This patch updates how we calculate subtotal to display such that we calculate in same way.
2019-11-27 04:43:23 +05:30
vedanshujain 1de30e8963 Refactor so that trait don't have class specific functions. 2019-11-26 01:30:45 +05:30
vedanshujain 60cd7b3651 Refactor Order Class to use shared calculation logic.
We added a trait to move shared logic betweem Orders and Cart. This commit refactors Order class to use that shared logic.
Also adds a test for a failing case.
2019-11-25 17:53:14 +05:30
vedanshujain bee7ea4490 Add trait which contains common total calc logic.
`WC_Abstract_Order` and `WC_Cart_Totals` have their own logic to calculate totals. This means that we would have to fix in two places. This commit adds a trait which can be used to place shared logic between above two classes.
2019-11-25 17:53:14 +05:30