Commit Graph

59 Commits

Author SHA1 Message Date
Mike Jolley e677340fcc No need to load tax rates when taxes are disabled 2018-05-01 11:56:39 +01:00
Claudio Sanches 67cd6b8fbf Fixed includes/class-wc-cart-totals.php PHPCS violations 2018-03-16 14:47:18 -03:00
claudiulodro f39a9ee61a Round fractional cents when oob 2018-03-14 08:35:41 -07:00
Torre Lasley 64f85346c0 Add filter to allow plugins to override the default coupon apply order. (#19339)
* Fix for Issue #10523 - Variations ID lookup by SKU

I copied the code from the bulk() function to look up the Variation ID by the Variation SKU if the Variation ID is missing.

* Added new filter woocommerce_coupon_sort to allow plugins to override the default coupon apply order.
2018-03-13 10:26:22 +00:00
Mike Jolley a44e4f64ac Round correctly when removing taxes from prices. 2018-01-05 14:56:33 +00:00
Mike Jolley 7a94bf06df Reversion changes 2017-12-07 15:39:10 +00:00
Mike Jolley 7e7b79efd0 typo 2017-12-07 15:31:55 +00:00
Mike Jolley b6f87e70d7 round total to cents 2017-12-04 22:42:39 +00:00
Mike Jolley 7da5780c00 Store unrounded, calc rounded. 2017-12-04 21:40:12 +00:00
Mike Jolley 277127a400 Round line totals and taxes per line correctly to the store DP setting. 2017-12-04 20:38:00 +00:00
Mike Jolley 6ef391666f Only remove base taxes in cart totals class if item is taxable
Fixes #17880
2017-11-23 11:08:10 +00:00
Mike Jolley 15230e295c Add precision after multiplying quantity
Closes #17860

Has no effect on core it seems because we only store prices to the DP
setting. This would be to correct precision added by plugins.
2017-11-22 10:49:28 +00:00
Mike Jolley ec5db3b123 When adding precision to taxes, don't round when adding precision. 2017-11-20 16:30:23 +00:00
Mike Jolley 040443a04d Out of base rounding error fixes 2017-11-02 20:00:49 +00:00
Mike Jolley 9ea088f6c9 Adjust discount logic when out of base 2017-11-02 16:18:51 +00:00
Mike Jolley 65f2ee0f49 Cart totals: don't add shipping unless show_shipping is true.
Closes #17412
2017-10-27 17:30:33 +01:00
Claudiu Lodromanean 3aa43ed5d2 Calculate shipping after discounts (#17364)
* Calculate shipping after discounts

* Calculate grand total after shipping is calculated

* Keep fees calculation before shipping
2017-10-26 15:27:10 +01:00
Mike Jolley f27c8a226f Fix issue when customer is VAT exempt and prices include tax
Ref: https://github.com/woocommerce/woocommerce-eu-vat-number/issues/82

In this scenario, base taxes need to be removed from the item price.
2017-10-18 09:31:35 -07:00
Mike Jolley d694483735 Fix tax display issue for discounts 2017-10-13 14:36:35 +01:00
Mike Jolley 4f3393fc2f Tax calculations should use `unfiltered` context for tax class
This fixes variations which have a ‘parent’ tax class. It should
inherit from the parent.

Closes #17147
2017-10-12 10:12:20 +01:00
lars ac24a56ff3 #16938 rename filter for clarity 2017-10-04 10:56:56 +02:00
lars 73bc8b8e6c added actions and filters to modify tax calculation for shipping taxes and fee taxes #16938
Filters and actions are needed to ensure correct tax calculation by
German law.

The filter in class-wc-cart-totals.php is used to modify fee tax
calculation during checkout and in cart.

The actions in the other files are used to modify tax calculation in
backend for manual orders.
2017-09-28 12:52:55 +02:00
Mike Jolley f1f56423c0 Docblocks 2017-09-27 17:16:33 +01:00
Mike Jolley 40040f534b These classes require WC_Cart objects 2017-09-27 17:12:45 +01:00
Mike Jolley 5151415eec Merge branch 'discounts-class-fixes-and-tests' 2017-09-20 18:44:18 +01:00
Mike Jolley 21dfde842a Revised coupon sort order to not rely on IDs which can differ between cart and tests
Also edited test to match
2017-09-20 18:41:48 +01:00
Mike Jolley d3da954133 Move cart totals setter for 3.1 compat
Closes #16794
2017-09-15 11:15:50 -07:00
Mike Jolley 804feb9333 Store fee amount and prevent totals going negative 2017-08-23 12:15:06 +01:00
Mike Jolley 559982fbe7 Unused variable 2017-08-22 17:02:48 +01:00
Mike Jolley 00cb48a5fe Pass through to order 2017-08-22 16:20:23 +01:00
Mike Jolley 367f08d79f Negative fee logic for cart 2017-08-22 16:12:37 +01:00
Mike Jolley 1c8ad67a9e Fix tests and tax merges 2017-08-18 15:05:01 +01:00
Mike Jolley b854c1775c Tests 2017-08-18 13:53:22 +01:00
Mike Jolley 302512e51f Combine taxes correctly 2017-08-18 13:48:53 +01:00
Mike Jolley 3c18d5e849 Adjust total discount for ex.tax 2017-08-15 16:25:39 +01:00
Mike Jolley 392ce417bc docblocks 2017-08-15 12:21:12 +01:00
claudiulodro ae80d12d80 Merge master 2017-08-14 11:12:09 -07:00
Mike Jolley e20d886972 calculate_item_discounts for clarity 2017-08-11 16:16:36 +01:00
Mike Jolley 51dffc0853 Apply logical sort order to discounts
Closes #16394
2017-08-10 17:24:27 +01:00
Mike Jolley 1fd1699bcd Ensure isset 2017-08-10 11:25:08 +01:00
Mike Jolley 81806617d7 Fix total and rounding logic for tests 2017-08-08 09:24:26 +01:00
claudiulodro 80708255ee Fix inc tax price calculation 2017-08-02 11:07:33 -07:00
claudiulodro 8fac8fc80b Cleanup 2017-07-31 13:18:39 -07:00
claudiulodro 43cbcd04ef Remove extra calcs and populate item totals 2017-07-31 11:48:34 -07:00
Claudio Sanches de52221004 Fixe fatal error while trying to sum an empty array 2017-07-28 17:38:43 -03:00
Mike Jolley c16df62b54 Fix tests and bootstrap 2017-07-28 17:43:08 +01:00
Mike Jolley 64e04c614a fix variable in calculate_discounts 2017-07-28 16:43:51 +01:00
Mike Jolley e23e55bb27 Methods for getting specific totals and discounts whilst keeping storage in a single array 2017-07-28 15:35:41 +01:00
Mike Jolley 51fbb1aec3 set_items_from_cart 2017-07-28 13:02:39 +01:00
Mike Jolley fcfa510445 Fixed totals tests 2017-07-27 16:57:05 +01:00