Mike Jolley
7f787fac84
Check empty strings literally
...
Closes #13565
2017-03-14 12:17:49 +00: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
Mike Jolley
8f2746049d
has_meta method
2017-03-14 12:08:33 +00:00
Mike Jolley
186c26e60d
Missing return in offsetSet
2017-03-14 11:33:35 +00:00
Mike Jolley
f404eeede6
get_formatted_meta_data should ignore meta with no ID
2017-03-14 11:28:57 +00:00
Claudio Sanches
591327287a
Do not set remaining downloads when is unlimited
2017-03-13 21:24:59 -03:00
Claudio Sanches
f1c08f1a8e
Updated downloads view on admin
2017-03-13 20:54:43 -03:00
Claudio Sanches
c4134586cd
FUpdate how save download dates
2017-03-13 20:54:33 -03:00
Claudio Sanches
aaeab5b81e
Use WWC_DateTime for access_granted
2017-03-13 20:36:04 -03:00
Claudio Sanches
792fe08f1d
Updated WC_Customer_Downloads to use WC_DateeTime
2017-03-13 20:29:55 -03:00
Claudiu Lodromanean
9b7c08fe8f
Update post type page with new date
2017-03-13 15:16:03 -07:00
Mike Jolley
02c826ba5e
Correctly handle null values
2017-03-13 22:14:20 +00:00
Claudiu Lodromanean
12952ebcd0
Update coupon meta box with new date handling
2017-03-13 15:06:44 -07:00
Claudiu Lodromanean
b018cdc037
Update legacy coupon class with new date handline
2017-03-13 15:05:57 -07: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
Claudiu Lodromanean
258845fb7b
Use GMT timestamp when comparing expiry
2017-03-13 13:40:58 -07:00
Claudiu Lodromanean
7d9227d3af
Update coupon object with new date
2017-03-13 13:31:40 -07:00
Mike Jolley
dd1b8e35dc
API endpoints
2017-03-13 20:26:52 +00:00
Mike Jolley
1bac579df7
Date getters and setters
2017-03-13 19:52:44 +00:00
Mike Jolley
7e165413cf
Check for arrays, not serialised strings
...
Fixes #13556
2017-03-13 17:49:59 +00:00
Mike Jolley
c80fed52d8
Merge pull request #13571 from woocommerce/fix-13529
...
Check $_POST before trying to save order address inputs
2017-03-13 17:47:21 +00:00
Mike Jolley
38f31d3b8e
Remove broken coupon usage link
...
#13568
2017-03-13 17:27:59 +00:00
Claudio Sanches
75ae465924
Merge pull request #13564 from ramiy/i18n
...
i18n: escape translation strings and fix wrong usage of i18n functions
2017-03-13 14:08:41 -03:00
Claudiu Lodromanean
cf397cfbdd
Dont try and save inputs that arent there
2017-03-13 09:55:18 -07:00
Mike Jolley
19759a83b4
Merge pull request #13560 from JeroenSormani/php71-typecast-fix
...
Type cast ->get_weight() on WC_Cart::get_cart_contents_weight calcula…
2017-03-13 16:10:47 +00:00
Mike Jolley
e5c753e757
Merge pull request #13557 from woocommerce/fix-13526-admin
...
Keep date compatibility in WC_Ajax::get_customer_details()
2017-03-13 16:05:17 +00:00
Mike Jolley
d2bd1a422c
Merge pull request #13555 from woocommerce/fix-13526-rest-api
...
Update date usage in REST API v1 and v2
2017-03-13 16:04:38 +00:00
Mike Jolley
0098595339
Merge pull request #13554 from woocommerce/fix-13526-legacy-api
...
Fix dates in customer legacy endpoints
2017-03-13 15:59:02 +00:00
Rami Yushuvaev
d2457fe922
i18n: escape translation strings and fix wrong usage of i18n functions
2017-03-13 07:39:46 +02:00
JeroenSormani
91ce342e7c
Type cast ->get_weight() on WC_Cart::get_cart_contents_weight calculation
2017-03-11 19:01:58 +01:00
fuzzguard
1a99235dc8
Adding in proper error handling from 'lostpassword_post'
...
Since WP version 4.4.0 the 'lostpassword_post' hook has had the ability to handle error messages from the WP_Error class. This allows errors to to occur BEFORE the username or email address are validated against the WP.
wp-login.php
/**
* Fires before errors are returned from a password reset request.
*
* @since 2.1.0
* @since 4.4.0 Added the `$errors` parameter.
*
* @param WP_Error $errors A WP_Error object containing any errors generated
* by using invalid credentials.
*/
do_action( 'lostpassword_post', $errors );
if ( $errors->get_error_code() )
return $errors;
Proposal is to have this same process be respected by WooCommerce Lost Password process.
2017-03-11 11:43:21 +11:00
Claudio Sanches
98d26521d1
Keep date compatibility in WC_Ajax::get_customer_details()
2017-03-10 20:13:56 -03:00
Claudio Sanches
3fbb8415d6
Change to single quotes
2017-03-10 19:14:28 -03:00
Claudio Sanches
8cefbd7c08
Added and fixed date properties for customers v2 endpoint
2017-03-10 19:10:41 -03:00
Claudio Sanches
7fb4340747
Updated dates for customers in REST API v1
2017-03-10 19:00:36 -03:00
Claudio Sanches
c6fa88bde8
Both $server-format_datetime() variables are false by default
2017-03-10 18:15:05 -03:00
Claudio Sanches
c353241599
Fixed dates in customer legacy endpoints
2017-03-10 18:10:03 -03:00
Claudio Sanches
b36fea1ce5
[REST API] Use the same order as schema for refunds response
2017-03-10 17:26:36 -03:00
Claudio Sanches
65ed14635e
Change bback $item to $data
2017-03-10 17:22:38 -03:00
Claudio Sanches
4ea40d997b
[REST API] Improved order of items in Orders endpoint schema
2017-03-10 17:20:27 -03:00
Mike Jolley
ff4b79a6fc
Status transition hooks should never run when objects are read regardless of status being set.
...
Fixes #13547
2017-03-10 20:20:07 +00:00
Mike Jolley
aac2e6a39c
Refund schema
2017-03-10 19:30:07 +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
e6752932dd
Sort
2017-03-10 19:05:32 +00:00
Mike Jolley
61484ed711
Update API endpoints
2017-03-10 18:54:59 +00:00
Claudiu Lodromanean
73ed273189
Use active voice
2017-03-10 10:32:27 -08:00
Claudiu Lodromanean
d630b948e3
Better increase/decreasing
2017-03-10 10:28:56 -08:00
Claudiu Lodromanean
e6a17a0fb3
Dont use set_prop on increase/decrease to prevent overwriting data
2017-03-10 09:27:39 -08:00
Claudiu Lodromanean
d70723553d
CHange vary to update
2017-03-10 09:18:14 -08:00
Mike Jolley
53962f1143
Other date_date call replacements
2017-03-10 16:43:05 +00:00
Mike Jolley
8ab839a030
Replace template usage of dates
2017-03-10 16:35:47 +00:00
Mike Jolley
84a1f0f92b
wc_rest_prepare_date_response handling for WC_DateTime
2017-03-10 16:30:32 +00:00
Mike Jolley
8e169ede98
Legacy handling
2017-03-10 16:30:06 +00:00
Mike Jolley
339b1b7aab
Set dates based on UTC
2017-03-10 16:29:52 +00:00
Mike Jolley
804573028d
wc_format_datetime function
2017-03-10 16:29:42 +00:00
Mike Jolley
05e6c506ce
Email dates
2017-03-10 16:29:15 +00:00
Mike Jolley
69cc8f5150
API dates
2017-03-10 16:28:50 +00:00
Konstantinos Kouratoras
f77b03ef94
Add missing trailing punctuation
...
Trailing punctuation is missing, causing duplication of the same text in translation, although it exists in another file:
https://github.com/woocommerce/woocommerce/blob/master/includes/api/class-wc-rest-settings-options-controller.php#L482
2017-03-10 17:01:47 +02:00
Mike Jolley
c2339e1983
Data store read
2017-03-10 14:48:18 +00:00
Mike Jolley
bdc302a9fb
Data store write
2017-03-10 14:44:00 +00:00
Mike Jolley
89fab41440
date_{paid|completed} getters and setters.
2017-03-10 14:25:40 +00:00
Mike Jolley
320cf818a5
Merge pull request #13539 from woocommerce/uses-gmdate-customer-last-update
...
Use GMT/UTC+0 when update customer last_update
2017-03-10 12:24:02 +00:00
Mike Jolley
66e8d9b054
Merge pull request #13530 from woocommerce/alt-fix-13496
...
Avoid filters during construct
2017-03-10 12:22:22 +00:00
Mike Jolley
2894d5aab0
Make needs_processing public so the data store can access.
2017-03-10 12:21:42 +00:00
Mike Jolley
4f1c433fbf
Merge pull request #13532 from woocommerce/fix/order-item-meta-cache
...
Fix order item meta functions cache busting.
2017-03-10 11:47:26 +00:00
Claudio Sanches
dbbe4617ee
Do not force integer since will be saved as string by WordPress
2017-03-10 01:58:57 -03:00
Claudio Sanches
948963f5c7
Uses GMT/UTC+0 when update customer lastt_update
2017-03-10 01:57:53 -03:00
Claudio Sanches
4f1577fb27
Added support new WC_DateTime in WC_Customer
2017-03-10 01:20:33 -03:00
Claudio Sanches
377fbf9c44
Use WordPress wp_get_password_hint() function to display passowd hint
...
Closes #13534
2017-03-10 00:48:19 -03:00
Justin Shreve
9724b67ab8
Fix order item meta functions cache busting.
...
The cache busting currently in `wc_add_order_item_meta`, `wc_update_order_item_meta`, and `wc_delete_order_item_meta` doesn't actually bust anything. The cache line looks like it is from 2.6. The relevent cache to bust is actually in the `order-items` group and has a different key/prefix.
This bug allows your meta to get out of sync if you use these functions and then try to access a value from a CRUD object.
You can see this in the `test_wc_order_item_meta_functions` test I've added. If you keep your `wc-order-item-functions.php` as is, the asserts against `$item->get_meta` will fail.
To test:
* `phpunit --filter=test_wc_order_item_meta_functions`.
* Try before applying the `wc-order-item-functions.php` changes and after.
2017-03-09 13:36:23 -08:00
Justin Shreve
cd92351dd7
Fix direct property access for coupon amount.
...
In 2.6, you could access the amount via $coupon->coupon_amount. Or legacy code incorrectly handles $coupon->amount instead. 7778583340/includes/class-wc-coupon.php (L102)
This PR handles both since the RCs and betas allowed `->amount` and I don't want to break anything that may be accessing it that way..
To Test:
* `phpunit --filter=test_coupon_backwards_compat_props_use_correct_getters`
2017-03-09 10:34:45 -08:00
Mike Jolley
99776e6374
Merge pull request #13514 from woocommerce/fix-13509
...
Apply_changes nested array fix and tests
2017-03-09 17:32:19 +00:00
Claudiu Lodromanean
8a18702c27
Just use array_replace_recursive in apply_changes
2017-03-09 09:06:05 -08:00
Claudiu Lodromanean
3aea9a0b2f
DRY out the meta bumping functions
2017-03-09 08:51:47 -08:00
Mike Jolley
6848fad224
Merge branch 'timezone-poc' into fix-13498
2017-03-09 16:10:07 +00:00
Mike Jolley
ac1c2f02b7
syntax
2017-03-09 14:53:52 +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
9427eb048d
Set default status in getter, not during contruct.
...
Prevents loops like in Prospress/woocommerce-subscriptions#1902
2017-03-09 13:45:33 +00:00
Mike Jolley
92f989d8ac
Merge pull request #13528 from woocommerce/fix/legacy-get-item-downloads
...
Fix legacy get item downloads
2017-03-09 13:26:54 +00:00
Mike Jolley
a5c10d07c1
Fix is_purchasable (requires save) when price is null
...
Fixes #13043
2017-03-09 13:26:12 +00:00
Boro Sitnikovski
deae95b678
Updates after PR review
2017-03-09 12:55:33 +01:00
Mike Jolley
d811317a1f
Merge pull request #13511 from franticpsyx/fix-price-incl-excl-tax-zero-empty-inputs
...
[2.7] Unexpected wc_get_price_{in/ex}cluding tax behavior with zero/empty inputs
2017-03-09 11:46:39 +00:00
Mike Jolley
a185e57ccb
Admin panel should not hide _ meta.
...
Fixes #13510
2017-03-09 11:45:22 +00:00
Boro Sitnikovski
6c967697d9
Fix legacy get item downloads
2017-03-09 12:41:25 +01:00
Mike Jolley
a598baaf9e
date helper methods
2017-03-09 11:06:36 +00:00
Illimar Tambek
21a54b93d8
Use wc_clean to sanitize fee title in legacy apis
...
This will bring legacy APIs in line with the new REST API, where the
order item names are sanitized using wc_clean and fix the
backwards-incompatible change of using sanitize_title.
2017-03-09 11:00:35 +02:00
Illimar Tambek
8e81a7e4e0
Set order id for fees & shipping on legacy api
...
If order ID is not set, the item will be created, but will not be
associated with the order being updated.
2017-03-09 10:53:10 +02:00
Claudiu Lodromanean
e36ee46dea
Make increase_usage_count work correctly on concurrent checkoutt
2017-03-08 15:27:37 -08:00
Claudiu Lodromanean
3b8eb75c93
Better handling of nested arrays in apply_changes
2017-03-08 11:51:38 -08:00
Mike Jolley
94eaa67bc9
to string method
2017-03-08 18:14:37 +00:00
Mike Jolley
a490b85d3e
Handle saves
2017-03-08 16:51:46 +00:00
Mike Jolley
46416a7e36
WC_DateTime wrapper class
2017-03-08 16:51:35 +00:00
Mike Jolley
165cdca92b
Display date in admin using offset
2017-03-08 16:51:22 +00:00
Mike Jolley
c7dc8ae2b4
date_created and date_modified getters and setters
2017-03-08 16:51:10 +00:00
Mike Jolley
1a9c49db25
set_date_prop helper to convert dates in setters
2017-03-08 16:50:38 +00:00
Manos Psychogyiopoulos
5e8df27945
fix wc_get_price_{in/ex}cluding tax behavior with zero/empty inputs
2017-03-08 18:21:36 +02:00
Michael Pretty
6150ee2fde
Validate the parent order ID by calling wc_get_order() instead of get_post()
2017-03-08 08:02:18 -05:00
Claudiu Lodromanean
28f8380ab6
Sprinkle some periods
2017-03-07 15:00:14 -08:00