Commit Graph

297 Commits

Author SHA1 Message Date
Nestor Soriano 7485b9165f Convert optional-before-required arguments to required.
In PHP 8 required parameters after optional parameters in
function/method signatures trigger a deprecation notice. These type
of parameters are pointless since a value needs to always be
provided for them anyway, so they are actually de-facto required.

This commit converts all these not-so-optional parameters into
truly required parameters by removing their default values.
2020-10-02 09:45:09 +02:00
Nestor Soriano 53d33457e3 Fix code style/sniffer errors in a few files. 2020-10-02 09:34:09 +02:00
Ron Rennick d3ab19b7cf eliminate internal use of deprecated functions
- remove deprecation of offsetGet as it is used throught abstract order
- eliminate use of offsetGet in unit tests, structured data, order functions
-
2020-07-17 17:14:26 -03:00
Claudio Sanches 950b2253cb
Merge pull request #26846 from woocommerce/add/new_order_note_action
Add `woocommerce_order_note_added` action
2020-07-01 12:56:55 -03:00
Alamgir 5cda3967ff Fix - wrong capabilites use on add order note issue fixed 2020-07-01 10:14:22 +06:00
Dan Bitzer 25fbe58872 Add order note action docblock 2020-06-24 09:35:46 +09:30
Dan Bitzer 9cddd9ae18 Add `woocommerce_order_note_added` action
This action provides an easier way to perform an action when a non-customer order note is added.
2020-06-23 16:55:08 +09:30
vedanshu.jain f684c749fc Add method to get base data from order object.
This method can be used when we need basic data about the object without
querying for lot more (and expensive) data from DB.
2020-03-27 20:09:29 +05:30
Claudio Sanches 0bec8443f4
Merge pull request #25137 from woocommerce/fix/24936
Only update the customer IP address when order gets created from admin
2020-01-30 19:41:08 -03:00
Peter Fabian 00f8e787be Bumped version string. 2020-01-30 10:16:19 +01:00
Claudio Sanches 2cb564d0ab Updated since tag to 3.10.0 2020-01-29 18:35:07 -03:00
Jeremy Pry 19684ceb6c
Add second parameter to `woocommerce_valid_order_statuses_for_payment` filter.
Everywhere the `woocommerce_valid_order_statuses_for_payment` filter is used, a second parameter is passed: the `WC_Order` object. This parameter was missed in #25158.

Omitting this parameter can cause errors in other extensions expecing that it will be present when hooking into the filter.
2019-12-31 15:13:50 -05:00
Claudio Sanches a12c25862b
Revert "Add support for '_held_for_checkout` records to prevent race conditions." 2019-12-04 16:03:05 -03:00
Claudio Sanches 0c486785ad
Merge pull request #25089 from woocommerce/fix/24009
Add support for '_held_for_checkout` records to prevent race conditions.
2019-12-03 17:47:22 -03:00
Claudio Sanches 988b72e461 Updated filter name to woocommerce_hold_stock_for_checkout
Also fixed coding standards
2019-12-03 16:38:17 -03:00
Gerhard da33f216ea PHPCS fixes 2019-12-03 16:22:13 +02:00
Gerhard 1f678767a9 Introduce woocommerce_order_payment_status_changed action and logic around it when an order progresess from a pending payment to a paid status, in prep for Order status work. 2019-12-03 16:20:24 +02:00
Peter Fabian fa38299ad1 Added abstraction for checking the modus of order creation. 2019-11-29 15:32:38 +01:00
vedanshujain 2ac3a0dfc8 Code standard fixes. 2019-11-26 18:36:23 +05:30
vedanshujain 5ef41f1ecc Empty cart before test to make sure everything in cart exists 2019-11-26 18:21:24 +05:30
vedanshujain 70a54d0639 Added Unit Tests for `held_for_checkout` records. 2019-11-21 18:11:37 +05:30
vedanshujain e87024bb81 Add support for '_held_for_checkout` records to prevent race conditions.
When creating an order, if manage inventory is enabled then add a `_held_for_checkout` record with a expiry timestamp embedded. This is added in an atomic manner along with making a check whether we have current stock or not.
This record is removed when order status goes to either `processing` or `completed`.
2019-11-21 01:21:08 +05:30
Gerhard Potgieter 822d1ebb40
Merge pull request #24879 from woocommerce/add_order_note_before_do_action
Add order note before do_action() to maintain order of notes
2019-11-18 14:02:03 +02:00
Menaka S 0ec7da3925 Add new function WC_Order::add_status_transition_note 2019-10-24 12:53:42 +05:30
Menaka S 3f99d2264b Add order note before do_action() is called so that the order of order notes is maintained 2019-10-22 11:13:15 +05:30
Claudio Sanches c8a7b341fc Included order object to formatted address filters 2019-10-18 18:24:38 -03:00
Gerhard Potgieter fdbdb5c73a
Merge pull request #24677 from woocommerce/fix/illegal-offset-bug
Small refactor in WC_Order methods to get formatted address
2019-09-30 15:00:34 +02:00
Gerhard 35ff7e3149 Bump @since for woocommerce_order_get_formatted_shipping_address and woocommerce_order_get_formatted_billing_address filters 2019-09-30 14:42:06 +02:00
Gerhard Potgieter 6c000bfe39
Merge pull request #24526 from itzmekhokan/fix/24430
Fixed issue #24430
2019-09-27 14:00:43 +02:00
Claudio Sanches 52108c1577 Fixed "Illegal offset" error caused by #24146
Introduces new filters to better handle order's formatted addresses
2019-09-24 13:15:35 -03:00
Claudio Sanches e814105728 Prefer wc_get_checkout_url() instead of wc_get_page_permalink( 'checkout' ) 2019-08-30 13:06:50 -03:00
itzmekhokan a21c18ee9c Fixed coding standards for this comment. 2019-08-30 07:35:17 +05:30
Marco Almeida 80c2ecd692
Replace wc_get_page_permalink( 'cart' ) with wc_get_cart_url() 2019-08-29 08:46:25 +01:00
itzmekhokan c572d26170 Fixed wordpress coding standard 2019-08-29 10:25:32 +05:30
itzmekhokan 5234b85144 Fixed issue #24430 2019-08-28 22:25:14 +05:30
Gerhard fe2d46799f This PR reworks the intention of #23859 which causes failing unit tests due to $this->get_address( 'shipping' ) always returning an array even when no shipping address is present. 2019-07-14 20:34:30 +02:00
Gerhard Potgieter 6693b44a98
Merge pull request #23859 from RistoNiinemets/master
Allow filtering formatted shipping address
2019-07-14 20:24:44 +02:00
Risto Niinemets dbc9719d76 Use order raw address instead of formatted for filter 2019-06-04 08:13:40 +03:00
Risto Niinemets de1dfbb1b4 Allow filtering formatted shipping address 2019-06-03 09:18:36 +03:00
Mike Jolley 47eee0143f Restore order note on exception 2019-04-17 13:07:52 +01:00
Mike Jolley a0d4f6174c Consistent CRUD classes with before/after save hooks 2019-04-17 12:47:35 +01:00
Mike Jolley 1d7059ec90 Add other check in order totals too 2019-03-11 16:59:38 +00:00
Mike Jolley 39d9e4bd6f If date paid is not set but payment complete status has passed, set it anyway Ref: #22688 2019-02-14 14:45:26 +00:00
Mike Jolley 6367d19615 phpcs 2019-01-21 08:11:40 -08:00
Chris Shultz 2506ff250b Triggering woocommerce_order_edit_status on single order status edit. 2018-09-12 10:07:02 -07:00
Mike Jolley 9f86839cab Remove wc_transaction_query in favour of logging 2018-06-14 14:39:18 +01:00
Claudio Sanches 9a55d16f44 Fixed includes/class-wc-order.php PHPCS violations 2018-03-21 00:44:44 -03:00
Mike Jolley 21d7dbc612 Merge branch 'master' into update/17252 2018-03-01 15:58:17 +00:00
Mike Jolley 69816b9854
Merge pull request #18538 from woocommerce/update/16366
Optimise saving of orders
2018-02-22 12:20:14 +00:00
Claudiu Lodromanean 59b61ab744
Merge pull request #18408 from macbookandrew/downloadable_items_filter
add file array key similar to other functions
2018-02-08 10:38:12 -08:00