Commit Graph

71 Commits

Author SHA1 Message Date
Claudio Sanches 9c4ac29137
Merge pull request #26565 from woocommerce/fix/26510
Allow set "order key" while creating order via CRUD
2020-07-01 12:42:18 -03:00
Claudio Sanches 7534e2eba0 Allow set "date_created" while creating orders via CRUD 2020-05-20 18:04:49 -03:00
Claudio Sanches ea19190d3b Allows to set custom order_key while creating an order 2020-05-20 17:14:17 -03:00
Christopher Allford 1d1413b4ee Replaced direct access of many constants with the Constants library 2020-01-31 22:18:47 -08: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
Mike Jolley 9ea63486e6 Add get_post_status helper method and ensure prefix gets added for most statuses 2019-04-03 14:21:38 +01:00
Mike Jolley 5749369ba5 Update coupons and orders to use update_or_delete_post_meta 2019-02-19 15:35:05 +00:00
Mike Jolley ae17d6f3bd Avoid handling wc-auto-draft
WC was erroneously adding wc- prefix to the core WP auto-draft status.

#22380 registered it formally but we don't need it.

I've reverted #22380 and handled the prefix correctly.
2019-02-13 17:52:28 +00:00
Mike Jolley 6367d19615 phpcs 2019-01-21 08:11:40 -08:00
Rodrigo Primo ece9f02776 Revert "First pass at using post_author instead of the post meta '_customer_user'"
This reverts commit 61c7abce4f.
2018-10-29 11:48:44 -03:00
Rodrigo Primo be4132e228 Revert "Set post_author to 0 for refund orders"
This reverts commit ad4304450d.
2018-10-29 11:47:00 -03:00
Rodrigo Primo 43d22a2349 Merge branch 'master' into update/use-post-author-for-customer-id 2018-06-18 15:17:19 -03:00
Mike Jolley 78636b1f12 Only cache if order ID is set. 2018-06-14 14:52:25 +01:00
Rodrigo Primo dd8bf8b522 Merge branch 'master' into update/use-post-author-for-customer-id 2018-06-11 10:44:14 -03:00
Mike Jolley 58e4802f47 Set date created if null during update 2018-05-15 19:15:42 +01:00
Rodrigo Primo a7d2c5dd6e Merge branch 'master' into update/use-post-author-for-customer-id 2018-04-03 15:13:07 -03:00
Rodrigo Primo 03c202f1f5 phpcs fixes in includes/data-stores/abstract-wc-order-data-store-cpt.php 2018-03-08 16:27:03 -03:00
Rodrigo Primo bf5c6f17a7 phpcs fixes 2018-01-09 15:42:08 -02:00
Rodrigo Primo ad4304450d Set post_author to 0 for refund orders 2017-12-08 12:32:45 -02:00
Rodrigo Primo 61c7abce4f First pass at using post_author instead of the post meta '_customer_user' 2017-11-28 10:13:30 -02:00
Rodrigo Primo 3d6bd30d8a Fix some PHPCS violations in includes/data-stores/abstract-wc-order-data-store-cpt.php 2017-11-24 17:25:31 -02:00
Rodrigo Primo e12fa54bc6 phpcbf automatic coding standard fixes 2017-11-23 12:16:47 -02:00
Jeremy Pry 2d4b7356df Update some docblocks with proper parameters 2017-08-18 12:18:19 -04:00
Brent Shepherd 1992d90d37 Revert "Merge pull request #14706 from crodas/make_get_item_consistent"
This reverts commit 56ffa3d2aa, reversing
changes made to 64a60de24f.
2017-06-27 22:28:23 -07:00
Mike Jolley 56ffa3d2aa Merge pull request #14706 from crodas/make_get_item_consistent
Make get item consistent
2017-05-31 11:10:09 +01:00
Cesar Rodas 001cf94ff3 Fixed typo 2017-05-30 10:37:29 -04:00
Mike Jolley ed32f9c792 Only delete if the object has an ID 2017-05-30 14:44:28 +01:00
Cesar Rodas ea9c573f2c Improved WC_Order::get_item()
Do not load all items, just load the items with a given order_item_type.
2017-05-23 20:12:47 -04:00
Cesar Rodas b612bab38b Fixed coding styles 2017-05-23 19:18:31 -04:00
Mike Jolley c16acc6b51 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	assets/css/wc-setup-rtl.css
#	assets/css/wc-setup.css
2017-05-23 19:00:24 +01:00
Mike Jolley d3666738d8 Merge branch 'pr/15069' 2017-05-23 18:56:58 +01:00
Mike Jolley 00e5189a05 Merge pull request #15070 from rasmusbe/phpdoc-missing-return-throws
Phpdoc: Add missing return and throws
2017-05-23 18:50:58 +01:00
Rasmus Bengtsson 185934fad9 Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
Rasmus Bengtsson 4a3902cd48 PHPDoc: Add missing throws statement 2017-05-15 13:39:03 +02:00
Rasmus Bengtsson 6a7fc8650f Remove unused local variables 2017-05-15 12:06:52 +02:00
Cesar Rodas 38f379a7d7 Make get_item() consistent (like get_items())
Right now get_item() is loading an item from the database directly. It doesn't
take advantage of our cache and it doesn't check if the item is already loaded in memory.

There is also another bug (or feature?) that it will let you load any item, even if the item is not related to the current order. I believe this is a bug, if somebody really wants to load any item regardless of the order they should use `WC_Order_Factory::get_order_item`.

Another bug is that items loaded with get_item() are not related to the order object, therefore any calls to Order::save() won't persist the changes made to the item.

This commits makes sure the item returned by get_item is loaded similarly like get_items() does, taking advantage of the cache and the $items protected property (chances are the item is already in memory, ready to be used).

If a given item is not found false will be returned. If item exists but it is not related to the current object it will return false as well (If this behaviour is wanted, I can easily change it load the item anyways instead of returning false).
2017-04-26 02:54:14 -04:00
Mike Jolley 1f28b9d0b8 Other object types 2017-04-15 21:18:24 +01:00
Justin Shreve 15bf1da7d5 Call save_meta_data before wp_update_post for data stores that use it, and refresh meta cache after. 2017-04-05 14:39:41 -07:00
Mike Jolley 0ad1f6a63f Merge pull request #13709 from woocommerce/fix-13708
Timezone/DST fixes
2017-03-24 10:25:08 +00:00
Mike Jolley 7e462b9cca Data store date handling 2017-03-23 00:10:29 +00:00
Mike Jolley 3b35d95c6a Use gmdate and GMT in data stores so times are not changed 2017-03-22 12:01:38 +00:00
Mike Jolley 414e2b9501 Shared cache for order items 2017-03-21 23:50:05 +00:00
Mike Jolley 2763abb605 Cache order items 2017-03-21 23:37:47 +00:00
JeroenSormani a29ba23fab Miscellaneous cleanup of typos + change some return types for IDE helpers 2017-03-20 11:03:14 +01:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
Mike Jolley d55653a408 Merge branch 'master' into fix-13498
# Conflicts:
#	includes/class-wc-order.php
#	tests/unit-tests/crud/data.php
2017-03-15 15:52:40 +00:00
Mike Jolley 61484ed711 Update API endpoints 2017-03-10 18:54:59 +00:00
Mike Jolley 28a8d05285 Handle date paid in getter and during save to avoid filters during construct 2017-03-09 14:40:19 +00:00
Mike Jolley a490b85d3e Handle saves 2017-03-08 16:51:46 +00:00
Mike Jolley 8440083fef Merge pull request #13443 from woocommerce/cache-groups
Standardize cache group names
2017-03-03 10:44:34 +00:00