Commit Graph

1523 Commits

Author SHA1 Message Date
Nestor Soriano 0eed82b3b7 Fix code standards violations introduced in #25092 2020-04-07 12:28:30 +02:00
Vedanshu Jain 237463c39b
Merge pull request #25800 from woocommerce/fix/25748
Fixes tax rounding issues
2020-04-07 00:24:34 +05:30
Néstor Soriano 13765d9e91
Merge pull request #25092 from leanzafrancesco/fix/25091
Fix/25091 - Wrong totals in orders with taxable and non-taxable products and percentage coupons
2020-04-06 12:31:07 +02:00
Rodrigo Primo e40ddc5291
Merge pull request #25727 from leanzafrancesco/add/order-tax-location-filter
Add woocommerce_order_get_tax_location filter
2020-03-05 13:48:40 -03:00
vedanshujain a0c209193b Remove rounding because individual lines would already have been rounded at this point if needed. 2020-03-02 15:19:16 +05:30
vedanshujain 740e2c8a92 Treat individual tax totals as line items because they will be totalled later.
This means that we won't round them individually unless we have setting for round at line item enabled.
2020-03-02 15:19:16 +05:30
vedanshujain 48e63adf77 Make rounding methods consistent in orders and cart 2020-03-02 15:19:16 +05:30
Peter Fabian 150c77ba29 Improve coupon name output handling. 2020-02-26 12:24:04 +01:00
Francesco Leanza 5dfb618ff9 Add woocommerce_order_get_tax_location filter 2020-02-21 11:45:06 +01:00
Peter Fabian ee865fe0b4
Merge pull request #25504 from woocommerce/update/order-detail-summary
Enhance order details and payment summary
2020-02-06 11:40:45 +01:00
Peter Fabian 147266f44f Updates to reflect PR feedback. 2020-02-04 21:43:29 +01:00
Christopher Allford 1d1413b4ee Replaced direct access of many constants with the Constants library 2020-01-31 22:18:47 -08:00
Peter Fabian 248e69960b Merge branch 'master' into update/order-detail-summary 2020-01-30 17:41:32 +01:00
Peter Fabian ec8d477b09 PHPCS fix. 2020-01-30 17:09:33 +01:00
Christopher Allford 6ad091a9b7 Changed all of the constant accesses into corresponding Automattic\Jetpack\Constants usages 2020-01-28 21:21:29 -08:00
Peter Fabian 1f9cd9eae9
Merge pull request #24066 from malviyaritesh/fix/24062
Filter meta value even if key not found
2020-01-23 14:59:39 +01:00
Claudio Sanches 85a077b939 Coupon race condition prevention 2020-01-06 19:44:24 -03:00
Claudio Sanches 7701d4b57c
Merge pull request #25286 from woocommerce/fix-phpcs-violations
Fix PHPCS violations automatically using PHPCBF
2019-12-23 12:22:42 -03:00
Rodrigo Primo 7337ab60c2 Fix PEAR.Functions.FunctionCallSignature violations
This commit fixes all violations of the PEAR.Functions.FunctionCallSignature sniff automatically using phpcbf.
2019-12-20 15:25:23 -03:00
Rodrigo Primo 487f96d844 Fix WordPress.DateTime.CurrentTimeTimestamp vilations
This commit fixes all violations of the WordPress.DateTime.CurrentTimeTimestamp sniff automatically using phpcbf.
2019-12-20 14:23:05 -03:00
Rodrigo Primo 62d6b05b58 Fix Generic.Formatting.MultipleStatementAlignment violations
This commit fixes all violations of the Generic.Formatting.MultipleStatementAlignment sniff automatically using phpcbf.
2019-12-20 14:21:08 -03:00
Rodrigo Primo 94373f78ea Fix WordPress.Arrays.MultipleStatementAlignment errors automatically using phpcbf 2019-12-20 13:51:26 -03:00
Rowayda.Khayri f6574e3f91 fix a typo 2019-12-20 18:45:34 +02:00
David Levin d25178b793 rename fee method again 2019-12-18 22:19:34 -08:00
Matt Harvey 4326e39250 Leave other fee total logic alone, reduce the fee array to get a simple sum 2019-12-18 22:08:39 -08:00
Matt Harvey 4eeec4705d Abstract fee calculation and expose as method to abstract Object class. 2019-12-18 20:58:39 -08:00
vedanshujain 72545c44b7 Add support for `_held_for_checkout` records to improve performance.
This will also improve transactional stability and avoid race conditions by providing a way to lock usage counts.
2019-12-17 19:13:19 +05:30
Francesco Leanza 59af851069
Merge branch 'master' into fix/25091 2019-12-09 16:46:02 +01:00
Claudio Sanches d7e2a98aaf
Merge pull request #24828 from woocommerce/fix/24695
Adds shared code between Orders and Cart calculation logic.
2019-12-05 12:39:50 -03:00
Claudio Sanches 0686e6f1cd
Merge pull request #25000 from woocommerce/feature/pay-button-support
Initial support for "pay button"
2019-12-04 16:02:02 -03:00
Rodrigo Primo 4af9a94129 PHPCS fixes 2019-12-04 15:52:20 -03:00
Claudio Sanches adbb4fd2d3
Merge pull request #24937 from jenkoian/wc-placeholder-attrs
Add support for custom attributes to wc_placeholder_img().
2019-12-04 15:42:41 -03:00
Rodrigo Primo 02ae8d1206
Merge pull request #24292 from woocommerce/fix/24116
Prevent PHP notices in WooCommerce widgets using Gutenberg's Legacy Widget Block
2019-12-03 14:25:05 -03:00
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
Francesco Leanza dd3427958b Fixed order totals calculation if it contains taxable and non-taxable products and percentage coupons
Added PHPUnit tests
2019-11-21 11:28:22 +01:00
Claudio Sanches d53b73b56c Added support for "pay button" feature 2019-11-07 17:22:33 -03:00
Ian Jenkins 2340f269cf Add support for custom attributes to wc_placeholder_img().
When displaying a list of images you often want a specific class to be
attached to each image, therefore you pass through a custom class using
the attr parameter. Unfortunately this doesn't get passed through to a
placeholder image should one be needed. This means that, for example, if
you're custom class center an image or something, it won't be honoured
for placeholders, which can lead to some wonky image listings.

You can work around this currently by leverging the
`woocommerce_product_get_image` filter, but it's a bit gnarly as you
need to do some regexing or string splitting or something and checking
class names and what not. This provides a much easier way, by
supporting custom attrs on placeholder images as is the case for non
placehodler images.
2019-10-30 15:08:19 +00:00
Gerhard Potgieter c01a0916c3
Merge pull request #24559 from itzmekhokan/fix/24458
Fix backordered product missing backordered label on frontend
2019-10-02 15:28:26 +02:00
Vedanshu Jain 9641963001
Merge pull request #24740 from woocommerce/feature/24654
Make WC_Abstract_Order::recalculate_coupons() public
2019-10-02 15:56:36 +05:30
Vedanshu Jain 2188f9b788
Merge pull request #24341 from woocommerce/fix/24238
Check for max discount to be -ve to prevent overwriting fee.
2019-10-02 14:32:15 +05:30
Claudio Sanches 8c88cd9b6f Make WC_Abstract_Order::recalculate_coupons() public 2019-10-01 17:19:33 -03:00
Rodrigo Primo 4550bb6661
Merge pull request #24544 from woocommerce/fix/checkout-permalink
Prefer wc_get_checkout_url() instead of wc_get_page_permalink( 'checkout' )
2019-09-25 20:38:38 -03:00
Ayesh Karunaratne eec96d367c
Fix a typo in WC Payment Gateway abstract '3rd party gateway size' 2019-09-18 10:22:16 +05:30
vedanshujain 6f2d64dcb4 Check for max discount to be -ve to prevent overwriting fee.
When we refund fee and some other line item whose value is more than fee in a single requst, value of line item will overwrite refund fee.

This is because where we check to make sure that we do not discount more than total possible value (to prevent negative total), we do not account for the fact that sometimes the cart could contain refund items. In those cases max_discount * -1 will always be larges then fees total.

This commit adds a check to make sure that max discount * -1 is indeed negative before overwriting fee total.
2019-09-03 20:45:33 +05:30
itzmekhokan dcf3d71c79 Fixed issue #24458 2019-09-02 12:40:44 +05:30
Claudio Sanches e814105728 Prefer wc_get_checkout_url() instead of wc_get_page_permalink( 'checkout' ) 2019-08-30 13:06:50 -03:00
Claudio Sanches 78c5a37b4b Prevent PHP notices in WooCommerce widgets using Gutenberg's Legacy Widget Block 2019-08-01 14:43:59 -03:00