claudiulodro
5b578c389f
Use previous filter name
2017-05-12 13:14:52 -07:00
claudiulodro
eee2ef82e8
Deprecate ->get_orders
2017-05-12 13:06:17 -07:00
Mike Jolley
e777b4d557
Merge branch 'feature/product-csv-import-export' into feature/csv-exporter
2017-05-12 21:03:20 +01:00
claudiulodro
3861e32803
Migrate wc_get_orders
2017-05-12 11:45:01 -07:00
Claudiu Lodromanean
c6fc0003c3
Merge pull request #14971 from woocommerce/improvement/13646
...
WC_*_Query date queries
2017-05-11 21:43:41 -07:00
Claudio Sanches
663c1d5f51
Merge pull request #15012 from woocommerce/fix/14994
...
Correctly set rating during updates
2017-05-10 19:08:38 -03:00
claudiulodro
e31cbfd5c4
Formatting for readibility
2017-05-10 14:33:29 -07:00
Mike Jolley
4cacceeede
Variation handling
2017-05-10 22:16:53 +01:00
claudiulodro
d461ea86d6
Use local timezone for yyyy-mm-dd queries
2017-05-10 13:08:47 -07:00
claudiulodro
db1d5ac987
Simplify logic
2017-05-10 12:02:15 -07:00
claudiulodro
a0727fb8a1
Change to date array
2017-05-10 11:49:11 -07:00
Mike Jolley
37a544dd6f
Ensure needle is set
...
Fixes #15004
2017-05-10 19:30:34 +01:00
Mike Jolley
cd9119443a
Correctly set rating during updates
...
Fixes #14994
2017-05-10 19:21:38 +01:00
claudiulodro
5d86b2f001
Formatting
2017-05-09 14:55:39 -07:00
claudiulodro
93835f69db
New working date query format
2017-05-09 14:49:45 -07:00
claudiulodro
c89e389b3f
Good progress towards better date queries
2017-05-09 11:37:45 -07:00
Mike Jolley
19fb7ac079
Fix hardcoded table name
2017-05-09 19:17:24 +01:00
Diego Zanella
3f3f2bdc2c
New filters for customer total spent
...
* Added new filters to allow altering the calculation of customer's total spent:
* `woocommerce_customer_get_total_spent`
* `woocommerce_customer_get_total_spent_query`
2017-05-08 19:39:13 +01:00
Mike Jolley
a741f2c7bf
Make other queries match the new query in 14936
2017-05-08 19:08:59 +01:00
Mike Jolley
b961d6fb74
Correctly exclude terms in wc_get_related_products
...
Fixes #14909
2017-05-08 14:15:16 +01:00
Mike Jolley
dd3be1278b
Merge pull request #14733 from woocommerce/feature/13646
...
WC_Object_Query & WC_Order_Query
2017-05-07 14:24:12 +01:00
Claudio Sanches
421c9a3ba7
Introduced woocommerce_shop_order_search_results filter
...
Closes #14857
2017-05-03 18:14:41 -03:00
Claudio Sanches
63552c9757
Fixed conflict between global attributes and custom attributes.
...
Check if is a custom attribute before trying to get an ID from a global attribute.
2017-05-03 16:30:50 -03:00
claudiulodro
7c393a4469
Better time handling
2017-04-28 14:01:06 -07:00
claudiulodro
1bb46ad876
Array filter results
2017-04-28 10:12:31 -07:00
Mike Jolley
af09548ec0
Add missing shipping_company from internal props in data store
...
Fixes #14768
2017-04-28 13:44:22 +01:00
claudiulodro
30d2332f48
Handle paginate
2017-04-27 19:14:48 -07:00
claudiulodro
0721354ff2
Add paginate
2017-04-27 15:02:02 -07:00
claudiulodro
11c7722eff
Update tests
2017-04-27 14:46:00 -07:00
claudiulodro
059389c684
Missed a spot
2017-04-27 14:13:06 -07:00
claudiulodro
4eb1396e85
Offload more to subclasses
2017-04-27 14:09:10 -07:00
claudiulodro
db3de7375d
Tweaks from feedback
2017-04-27 11:07:03 -07:00
claudiulodro
6aecb15505
Reduce scope
2017-04-27 08:38:18 -07:00
claudiulodro
020e24225a
Line up array
2017-04-26 14:20:44 -07:00
claudiulodro
1647e253a0
Add filters
2017-04-26 11:19:54 -07:00
claudiulodro
2fad12221d
Better comments
2017-04-26 11:04:28 -07:00
claudiulodro
9f0f0cd246
Polish and cleanup
2017-04-26 10:49:19 -07:00
Mike Jolley
481a5045aa
Merge pull request #14622 from jaumarar/patch-2
...
Fix: Creating customer triggers password changed
2017-04-26 14:32:28 +01:00
Mike Jolley
234bc3c017
Missing arg in data store too
2017-04-26 11:08:47 +01: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
claudiulodro
efa1dbbda5
Basic working order queries
2017-04-25 14:52:17 -07:00
Mike Jolley
8e624e6230
Filter invalid products before returning them for wc_get_products
...
Closes #14592
2017-04-25 14:03:30 +01:00
Jaume
5e53ed70d8
Fix: Creating customer triggers password changed
...
Sending POST /wc/v1/customers or POST /wc/v2/customers with the required args triggers the 'Notice of Password Changed' after creating the customer due to update() calls when the password still has a value.
2017-04-22 20:06:56 +02:00
Mike Jolley
a325d03deb
wc_get_orders support for guest orders and unit tests
...
Fixes #14575
2017-04-20 18:05:58 +01:00
Claudio Sanches
0b60af0774
Merge pull request #14415 from woocommerce/fix/save-post-infinite-loops
...
Prevent infinite loops during save_post
2017-04-20 00:44:57 -03:00
Claudio Sanches
c90e71e890
Merge pull request #14509 from woocommerce/fix/14480
...
Only return product by SKU if published
2017-04-19 14:38:14 -03:00
Claudio Sanches
0d46a89f83
Check only if is not in trash
2017-04-19 14:27:19 -03:00
Mike Jolley
bdb01c4bea
is_existing_sku should check all post statuses except for trash
...
Fixes #14525
2017-04-19 11:32:49 +01:00
Claudio Sanches
f61646d1a2
Only return product by SKU if published
...
Fixes #14480
2017-04-18 21:32:52 -03:00
Mike Jolley
d4a8f3c25b
fix coupon update
2017-04-15 21:48:22 +01:00
Mike Jolley
1f28b9d0b8
Other object types
2017-04-15 21:18:24 +01:00
Mike Jolley
27c9006f77
Product data store loop protection
2017-04-15 21:04:41 +01:00
claudiulodro
96ed33f227
Use read_downloads in variations
2017-04-14 14:18:08 -07:00
Mike Jolley
21da0cf71f
Ensure name and file is set
2017-04-12 14:11:04 +01:00
Claudio Sanches
627d7a8790
Merge pull request #14278 from woocommerce/fix/14209-alt
...
Variation Attribute Name Fixes (simplified)
2017-04-11 17:25:28 -03:00
Mike Jolley
5cfed7569c
Simplify wc_is_attribute_in_product_name and change separator
2017-04-11 21:12:30 +01:00
Claudio Sanches
3278d9e5d7
Merge pull request #14255 from woocommerce/fix/14163
...
Download permissions; Convert dates to timestamp on read so UTC is preserved.
2017-04-11 16:51:20 -03:00
Mike Jolley
510adc652c
Download permissions; Convert dates to timestamp on read so UTC is preserved.
...
Fixes #14163
2017-04-11 13:13:03 +01:00
Mike Jolley
899176bee7
woocommerce_update_customer_args filter
2017-04-11 12:47:53 +01:00
Claudiu Lodromanean
903b176b99
Attribute title tweaks
2017-04-10 13:16:58 -07:00
Mike Jolley
243b7a0d3f
Exclude location meta from setters
2017-04-10 12:16:25 +01:00
Govind Kumar
2ea79cc5ed
Fixed issue #14124
2017-04-07 19:14:10 +05:30
Claudio Sanches
708df27719
Merge pull request #14117 from woocommerce/fix/14108
...
If variation tax class meta is not set, it should be 'parent' to support 2.6 data
2017-04-07 13:29:40 -03:00
Mike Jolley
7418b9f8b8
If variation tax class meta is not set, it should be 'parent' to support 2.6 data
...
Fixes #14108
2017-04-07 17:13:59 +01:00
Claudio Sanches
51c00cce09
Merge pull request #14099 from dixitadusara/issue-14089B
...
Modified suggestion of Invalid argument supplied for foreach ref #14089
2017-04-07 12:33:01 -03:00
Mike Jolley
4f412678bd
Ensure meta_value has valid keys in read_attributes
...
Fixes #14085
2017-04-07 10:59:59 +01:00
dixitadusara
e527b6608c
modified suggestion of Invalid argument supplied for foreach ref #14089
2017-04-07 15:27:52 +05:30
dixitadusara
3ba9063d3d
Invalid argument supplied for foreach - class-wc-product-data-store-cpt.php ref #14089
2017-04-07 13:24:34 +05:30
Mike Jolley
1b5cad3d78
Fix variation category restriction and limit to x uses
...
Fixes #14068
2017-04-06 21:51:11 +01:00
Claudio Sanches
14572c8d80
Merge pull request #13991 from woocommerce/fix/13928
...
When setting props, exclude deprecated ones
2017-04-06 16:20:34 -03:00
Mike Jolley
2877752e1f
array_flip
2017-04-06 20:18:14 +01:00
Claudio Sanches
0529e4efab
Merge pull request #14026 from woocommerce/fix/13978
...
Fix variable stock syncing
2017-04-06 16:06:26 -03:00
Mike Jolley
8f2287be12
Use get_children for comparison
2017-04-06 19:47:22 +01:00
Mike Jolley
5701b1f7e2
Get cross sells from parent
...
fixes #14054
2017-04-06 19:01:57 +01:00
Claudio Sanches
42ca7bda3d
Merge pull request #13989 from woocommerce/fix/product-meta-save_post
...
Fix saving meta when using `save_post`.
2017-04-06 14:38:16 -03:00
Mike Jolley
fd3e656912
Pull tax status from parent since there is no UI to set at variation level
2017-04-06 17:54:34 +01:00
Claudio Sanches
9a219b71da
Merge pull request #14036 from woocommerce/fix/14032
...
Make sure we have a prefix for strstr
2017-04-06 10:25:46 -03:00
Mike Jolley
822412d03c
Make sure we have a prefix for strstr
...
Closes #14032
2017-04-06 14:11:00 +01:00
Mike Jolley
a7a896008c
Fix up the child_is_in_stock function
2017-04-06 12:26:19 +01:00
Mike Jolley
d570a81241
Set session data only if the value is empty in customer object. Prevents session data overwriting customer data on login.
...
Fixes #13906
2017-04-06 10:28:32 +01:00
Mike Jolley
70778abade
When setting props, exclude deprecated ones
...
Fixes #13928
2017-04-05 23:16:45 +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
Claudiu Lodromanean
c02cee595e
Add missing download_id param
2017-04-05 13:37:42 -07:00
Mike Jolley
359213d720
Fix direction
2017-04-05 20:25:21 +01:00
Mike Jolley
0035afc5a0
Make sure we have number > 0 so all variations are not deleted
2017-04-05 20:22:05 +01:00
Claudio Sanches
f250cac8d1
Merge pull request #13967 from woocommerce/fix/13933
...
Use parent settings for determining if variations are sold individually.
2017-04-05 15:33:17 -03:00
Claudiu Lodromanean
5389844a1b
Use parent data for sold_individually
2017-04-05 11:02:26 -07:00
Mike Jolley
27b35c0515
Using WPDB is quicker than wp_update_post
2017-04-05 18:40:59 +01:00
Mike Jolley
ab4c921bd1
Wrap in try catch so WC_Data_Exceptions are caught on bad email.
2017-04-05 16:36:28 +01:00
Mike Jolley
71ce5b85bc
Merge pull request #13884 from woocommerce/fix-13875-13877
...
Private and variable product fixes
2017-04-03 19:16:35 +01:00
Mike Jolley
0a96f17747
Flip orderby
2017-04-03 12:12:13 +01:00
Mike Jolley
8598f82c8a
If user can edit private products, search them
...
Fixes #13877
2017-04-03 12:04:59 +01:00
Mike Jolley
31cd2dcb90
Merge pull request #13853 from woocommerce/crud-security-hardening
...
CRUD security/hardening
2017-04-03 11:09:38 +01:00
Mike Jolley
999a597055
Escaping in search orders
2017-03-31 17:14:08 +01:00
Mike Jolley
8a201b64c5
Only set dates if set/not null
...
Fixes #13848
2017-03-31 12:38:18 +01:00
Mike Jolley
14802a0307
Remove double unserialization
2017-03-31 12:10:20 +01:00
Mike Jolley
12e28a83f3
WC_Product_Variable_Data_Store_CPT::read_variation_attributes() cast to int
2017-03-31 11:37:12 +01:00
Mike Jolley
0d1cfe6fd2
Use prepare on `type` in payment token data store
2017-03-31 11:22:47 +01:00
Mike Jolley
f1a699c259
Cleanup
2017-03-31 11:18:22 +01:00
Mike Jolley
a443419006
remove extract and sanitize orderby against whitelist
2017-03-31 11:15:55 +01:00
Mike Jolley
399c141377
Fix slug updating in CRUD
...
Fixes #13824
2017-03-29 13:41:23 +01:00
Claudio Sanches
1c369e41e0
Merge pull request #13810 from woocommerce/fix-typo
...
Fix typo
2017-03-28 15:22:45 -03:00
Claudiu Lodromanean
28726570bf
Use new_* hooks instead of created_*
2017-03-28 11:05:45 -07:00
Akeda Bagus
0b416439c8
Fixed all typos of all files in includes/ directory.
...
Scanning and fixing were done automatically by codespell,
https://github.com/lucasdemarchi/codespell .
2017-03-29 00:58:51 +07:00
Mike Jolley
3c008b8a56
Check for null
2017-03-28 17:26:58 +01:00
Mike Jolley
9d9c9cdc9e
Merge pull request #13772 from crodas/order_item_should_check_if_there_is_any_change
...
Do not update order items every time if nothing changed
2017-03-28 15:28:40 +01:00
Mike Jolley
29d6f69a87
Revert "Clear parent transients on variation save"
...
This reverts commit 0694312cc9
.
2017-03-28 14:32:52 +01:00
Mike Jolley
e575904fbf
Revert "Clear parent transient on variation creation"
...
This reverts commit 5f573b8777
.
2017-03-28 14:32:46 +01:00
Mike Jolley
5f573b8777
Clear parent transient on variation creation
2017-03-28 14:01:02 +01:00
Mike Jolley
0694312cc9
Clear parent transients on variation save
2017-03-28 13:51:22 +01:00
Cesar Rodas
55ba115ac5
Make sure the changes includes either $name or $order_id
2017-03-28 08:47:01 -04:00
Claudiu Lodromanean
89128da8ba
Fix child_has_dimensions
2017-03-27 11:52:03 -07:00
Cesar Rodas
f2f6d76f6d
Do not update woocommerce_order_items if nothing changed
...
Do not update the item (`woocommerce_order_items`) unless something changed.
2017-03-25 00:30:12 -03: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
91f109c33d
Cache order item data
2017-03-21 23:38:04 +00:00
Mike Jolley
2763abb605
Cache order items
2017-03-21 23:37:47 +00:00
Mike Jolley
c4c8edee5f
Remove order and product factory cache
2017-03-21 23:37:38 +00:00
alarocca130
7dc539e43b
Fix: post_meta function for payment token meta
2017-03-21 17:41:00 +01:00
Mike Jolley
9bcfcb82c5
Merge branch 'master' into remove-product-internal-meta-keys
...
# Conflicts:
# includes/data-stores/class-wc-product-data-store-cpt.php
2017-03-20 16:13:45 +00:00
Mike Jolley
2dbf0d7560
Merge pull request #13656 from woocommerce/remove-post-internal-meta-keys
...
Remove post related internal post keys from products
2017-03-20 12:48:39 +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
2d400bffd2
Remove post related internal post keys froom products
2017-03-17 17:37:38 -03:00
Claudio Sanches
1a87792109
Remove some product internal meta keys
2017-03-17 17:30:38 -03:00
Claudio Sanches
0f4a8b88e2
Merge pull request #13612 from woocommerce/fix-payment-token-extra-data
...
Prevents combining empty arrays in WC_Payment_Token_Data_Store
2017-03-15 15:53:25 -03:00
Claudio Sanches
abb053b277
Prevents combining empty arrays in WC_Payment_Token_Data_Store
...
PHP 5.3 and 5.2 issue E_WARNING and return FALSE for empty arrays.
2017-03-15 15:39:24 -03:00
Claudio Sanches
c856abba3e
Change default WordPress auto-draft title for product
...
This helps handle variations title while syncing variations.
Using a translatable string can led to errors, like a auto-draft started
by an user with WP admin set up as pt_BR and published by an user in
en_GB.
2017-03-15 15:12:49 -03:00
Claudio Sanches
dfd2d7387c
Revert 71ecb57
2017-03-15 14:08:41 -03:00
Claudio Sanches
71ecb57d2d
Fixed missing text domain
2017-03-15 13:59:18 -03:00
Claudio Sanches
59c2849736
Changed version 2.7 to 3.0
2017-03-15 13:36:53 -03:00
Mike Jolley
75a5b062cf
Merge pull request #13577 from woocommerce/fix-13498
...
Timezone/Date method handling
2017-03-15 16:09:41 +00: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
a34dd0480d
Merge pull request #13587 from woocommerce/fix-13525
...
Update coupon date handling
2017-03-15 15:26:41 +00:00
Claudiu Lodromanean
111246771c
Use date_expires meta key
2017-03-15 07:38:57 -07:00
Boro Sitnikovski
74388dafbf
Do not pass `true` to `update_post_meta` as prev value.
2017-03-15 14:33:24 +01:00
Claudiu Lodromanean
cb3568add9
Add new meta key to internal meta keys
2017-03-14 14:14:07 -07:00
Claudiu Lodromanean
9e724d44cc
Save expiry time in new utc timestamp meta field
2017-03-14 12:49:40 -07:00
Justin Shreve
fb124232cf
Update Payment Tokens to follow the same pattern for custom data as other object types.
...
Payment tokens was introduced in 2.6 and was updated to use the new CRUD code while some of the CRUD system was still in flux.
While most things were correct, the prop handling for custom fields (like a card's last 4 digits) were directly calling meta functions, instead of delegating to the data store/parent.
This PR moves these props to `extra_data` and follows the same pattern as product types or order items. It also updates some version tags to 3.0.0. Finally, it adds an additional test for saving meta after a create which looks like it was lacking.
To Test:
* Run `phpunit`.
* Go to the "My Account" tab and add a new payment method. You need a payment gateway that supports this, like Simplify.
* Test the add a payment method flow.
* Make a test purchase using the saved payment method.
2017-03-14 12:33:35 -07:00
Claudiu Lodromanean
3476121709
Use local time where appropriate
2017-03-14 10:27:48 -07:00
Claudiu Lodromanean
f042305ff7
Update date_expires meta handling
2017-03-14 08:10:31 -07:00
Mike Jolley
e13badcdb3
Merge pull request #13584 from woocommerce/13527-update-downloads-dates
...
Apply WC_DateTime to WC_Customer_Downloads
2017-03-14 12:11:28 +00:00
Claudio Sanches
c4134586cd
FUpdate how save download dates
2017-03-13 20:54:33 -03:00
Claudiu Lodromanean
b3c846da56
Use 2.6-format data for the expiry_date meta value
2017-03-13 14:37:34 -07:00
Mike Jolley
9bee678819
API updates
2017-03-13 21:36:31 +00:00
Claudiu Lodromanean
f1925e561a
Update coupon data store to use new dates
2017-03-13 14:24:05 -07:00
Mike Jolley
1bac579df7
Date getters and setters
2017-03-13 19:52:44 +00:00
Mike Jolley
38afff0031
Merge pull request #13516 from woocommerce/fix-13505
...
Make increase_usage_count work correctly on concurrent checkout
2017-03-10 19:07:57 +00:00
Mike Jolley
61484ed711
Update API endpoints
2017-03-10 18:54:59 +00:00