Commit Graph

10611 Commits

Author SHA1 Message Date
Claudio Sanches c074c9d57b [REST API] Fixed date and included GMT dates to webhooks 2017-03-22 18:36:15 -03:00
Claudio Sanches 7f8c4b18e1 [REST API] Fixed date and included GMT date for webhook deliveries 2017-03-22 18:34:10 -03:00
Claudio Sanches 73f7a39d09 [REST API] Fixed timezone date and included GMT date to product reviews 2017-03-22 18:28:57 -03:00
Claudio Sanches 0f5e6373e4 [REST API] Include GMT dates for images in schema 2017-03-22 18:23:41 -03:00
Claudio Sanches dbd2409e03 [REST API] Added timezone and GMT dates in category image 2017-03-22 18:17:53 -03:00
refael iliaguyev d8cd0a7550 prevent flipping of color input in rtl 2017-03-22 22:12:07 +02:00
Mike Jolley 72be782e2a Merge pull request #13719 from rodrigoprimo/remove-unused-phpdoc
Remove phpdoc for non-existing argument on WC_Order_Item_Product::get_product()
2017-03-22 19:16:39 +00:00
Mike Jolley 31784f23e3 Merge pull request #13720 from rodrigoprimo/remove-unused-variable
Remove unused global variable from WC_Order_Item_Product::get_item_downloads()
2017-03-22 19:16:25 +00:00
Rodrigo Primo b47a7b52df Remove phpdoc for non-existing argument on WC_Order_Item_Product::get_product() 2017-03-22 16:04:49 -03:00
Mike Jolley 56d55517cc Merge pull request #13698 from woocommerce/remove-factory-cache
Remove factory cache
2017-03-22 19:02:53 +00:00
Mike Jolley b1e76fa68e Merge pull request #13718 from rellect/correct-hours-minutes-rtl
RTL - Correct hour:minute input alignment in order details
2017-03-22 19:02:29 +00:00
Rodrigo Primo ce9ecefa98 Remove unused global variable from WC_Order_Item_Product::get_item_downloads() 2017-03-22 16:00:11 -03:00
refael iliaguyev baef6f3907 correct hours:minutes inputs in rtl 2017-03-22 20:17:35 +02:00
Brent Shepherd 16cc914714 Restore prior order item length
To maintain backward compatibility with custom order item types,
like 'order_item_pending_switch' used by Subscriptions.
2017-03-22 10:11:46 -07:00
Mike Jolley a876862bfb Merge pull request #13693 from woocommerce/orders-refunds-fix-schema
Include missing api_refund item to order refunds schema
2017-03-22 15:21:37 +00:00
Mike Jolley b55f59e975 Merge pull request #13694 from woocommerce/fix-missing-settings-schema
Include missing payment gateways and shippingmethods settings schema
2017-03-22 15:21:27 +00:00
Mike Jolley 64905a4d5e Merge pull request #13692 from woocommerce/order-notes-dates
Include date_created_gmt in order notes endpoint
2017-03-22 15:21:19 +00:00
Claudio Sanches 7f7fbcbb5d Improve order notes schema 2017-03-22 10:53:59 -03:00
Claudio Sanches 8184757e8a Improved descrition of items in schema 2017-03-22 10:51:52 -03:00
Claudio Sanches 1480257768 Merge pull request #13704 from woocommerce/fix-13700
Allow `data-coupon` through kses
2017-03-22 10:47:01 -03:00
Claudio Sanches 7485b418d7 Improve api_refund description 2017-03-22 10:39:23 -03: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 15bbac6b5c Allow `data-coupon` though kses
Fixes #13700
2017-03-22 10:53:18 +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
David Anderson 57ab34f13e Remove redundant / awkward empty password check
WooCommerce here checks that the password is not empty. This check is redundant, because it is already performed by wp_authenticate_email_password() (which is invoked, eventually, by the call in WC to wp_signon() ). Moreover, it is harmful, because it prevents extension of the login form. For example, in my use case, I have added a code to be scanned by a smartphone app as an alternative to the password. When the code is scanned, a password is required.

This extra/redundant check for an empty password on the WooCommerce form prevents my already-working-on-the-standard-wp-login-form code from working here, and there's no way to work around it that isn't hacky/ugly (e.g. direct manipulation of $_POST).
2017-03-21 23:21:43 +00:00
Mike Jolley 795e6871c0 Merge pull request #13691 from woocommerce/fix-address-labels
Improve address labels to help translations
2017-03-21 21:28:16 +00:00
Justin Shreve d11e7a93ca Merge pull request #13695 from woocommerce/fix-undefined-error-payments-endpoint
Fixed undefined variables in payment methods endpoint
2017-03-21 14:12:57 -07:00
Justin Shreve 8392c793a7 Merge pull request #13690 from woocommerce/sleep-wakeup-data
Sleep and Wakeup for WC_Data
2017-03-21 14:12:01 -07:00
Justin Shreve f4add2839b Merge pull request #13688 from alarocca130/master
Fix: post_meta function for payment token meta
2017-03-21 13:55:54 -07:00
Claudio Sanches be8ec903b5 Include missing payment gateways and shippingmethods settings schema 2017-03-21 17:47:28 -03:00
Claudio Sanches d2e1565f97 Fixed undefined variables in payment methods endpoint 2017-03-21 17:34:16 -03:00
Claudio Sanches 3b1da48c8d Fixed type 2017-03-21 17:07:01 -03:00
Claudio Sanches 461543fdbf Include missing api_refund item to order refunds schema 2017-03-21 17:04:25 -03:00
Claudio Sanches ad1dab947e Include date_created_gmt in order notes endpoint 2017-03-21 16:37:06 -03:00
Claudio Sanches b528e25759 Improve address labels to help translations 2017-03-21 15:54:23 -03:00
Mike Jolley 98f5ba44e8 Protection against removed objects. 2017-03-21 18:31:38 +00:00
Mike Jolley add78adf0c Merge branch 'master' into sleep-wakeup-data 2017-03-21 17:42:35 +00:00
Mike Jolley 991927c2d8 Handle sleep and wakeup in WC_Data class 2017-03-21 17:42:34 +00:00
Mike Jolley 9d5aee2c73 Remove code which expands/changes objects in emails 2017-03-21 17:36:46 +00:00
Mike Jolley 3e7f902e75 Merge pull request #13685 from woocommerce/fix-13682
Use display value when searching the title
2017-03-21 16:59:52 +00:00
Mike Jolley 1c2c9968d3 Merge pull request #13684 from woocommerce/fix-13681
get_tax_refunded_for_item ignoring tax id
2017-03-21 16:59:40 +00:00
alarocca130 7dc539e43b Fix: post_meta function for payment token meta 2017-03-21 17:41:00 +01:00
Mike Jolley e2c73c2277 Tweak labels for customer reg
Closes #13676
2017-03-21 13:23:38 +00:00
Claudio Sanches f6d7e52e06 Merge pull request #13687 from woocommerce/fix-13674
Cleanup of wc_cart_totals_coupon_html
2017-03-21 10:23:17 -03:00
Claudio Sanches fadfa4d903 Merge pull request #13686 from woocommerce/fix-13660
Use h2 in shortcodes and product loops
2017-03-21 10:22:14 -03:00
Mike Jolley 83ca80d466 Spacing and rules 2017-03-21 13:14:51 +00:00
Mike Jolley 18c22a885d Cleanup of wc_cart_totals_coupon_html
#13674
2017-03-21 13:04:29 +00:00
Mike Jolley 7bea5db423 Use h2
Fixes #13660
2017-03-21 12:54:04 +00:00
Mike Jolley 78d564e02c Merge pull request #13665 from JeroenSormani/custom-order-item
Add required filters to allow custom order item types
2017-03-21 12:08:28 +00:00
Mike Jolley 317ca0965e Use display value when searching the title
Fixes #13682
2017-03-21 11:30:57 +00:00
Mike Jolley 3a2f3586ed get_tax_refunded_for_item ignoring tax id
Fixes #13681
2017-03-21 11:20:39 +00:00
Claudiu Lodromanean c0a01a1fe4 Dont set empty strings as tax totals 2017-03-20 15:14:41 -07:00
Jeroen Sormani 9724bcd698 Change filter 'get_order_item_classname' to have $id 2017-03-20 21:42:57 +01:00
refael iliaguyev af55947f87 Revert "Drop repeated conditions for rtl aligning, use variable instead"
This reverts commit a894e7b241.
2017-03-20 22:21:44 +02:00
Claudio Sanches ee15a48b7e Merge pull request #13654 from woocommerce/fix-12804
[REST API] Return attribute names instead of slugs
2017-03-20 16:45:50 -03:00
Jeroen Sormani d07d32c3d2 Add empty/not-false
Ref: https://github.com/woocommerce/woocommerce/pull/13665/files#r106967582
2017-03-20 20:17:49 +01:00
refael iliaguyev a894e7b241 Drop repeated conditions for rtl aligning, use variable instead 2017-03-20 20:53:16 +02:00
Claudio Sanches b7c53bda38 Merge pull request #13672 from woocommerce/schema-text
Schema text changes
2017-03-20 14:02:44 -03:00
Mike Jolley fe76452a61 Merge remote-tracking branch 'origin/master' 2017-03-20 16:25:40 +00:00
Mike Jolley f14ce2f5f4 Merge branch 'pr/13663' 2017-03-20 16:25:37 +00:00
Mike Jolley 357227f46a Code style 2017-03-20 16:25:30 +00: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 47036f2f48 Update setting wording 2017-03-20 16:08:53 +00:00
Mike Jolley 94148cf512 Text changes 2017-03-20 16:01:55 +00:00
Mike Jolley dea59579bb description changes, and usage of ID's instead of IDs 2017-03-20 15:47:51 +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
Mike Jolley 941815acf5 Merge pull request #13666 from JeroenSormani/miscellaneous-cleanup
Miscellaneous cleanup of typos + change some return types for IDE hel…
2017-03-20 12:41:33 +00:00
JeroenSormani a29ba23fab Miscellaneous cleanup of typos + change some return types for IDE helpers 2017-03-20 11:03:14 +01:00
JeroenSormani 373bdda4f8 Add required filters to allow custom order item types 2017-03-20 10:37:06 +01:00
Krzysztof Grabania b302d80707 Change default hidden shop_order columns
Since WC requires at least WP 4.4 we can use `default_hidden_columns` filter rather than creating user meta for hidden by default columns in shop orders. This PR also adds some conditional for hiding shipping or billing column based on `woocommerce_ship_to_countries` option.
2017-03-20 09:28:38 +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 e3c2c79e00 [REST API] Return attribute names instead of slugs
Closes #12804
2017-03-17 17:25:38 -03:00
Mike Jolley 196ba7b770 Ensure we have a product before checking if it exists
Fixes #13642
2017-03-17 16:26:26 +00:00
Justin Shreve a17ba8f3ad Merge pull request #13637 from woocommerce/fix/13636-serialized-data-stores
Preventing the instance Data Store from being serialized with the con…
2017-03-17 08:53:24 -07:00
Justin Shreve d457891bd8 Add punctuation to docblock comments. 2017-03-17 08:52:02 -07:00
Mike Jolley 2970a64516 Merge pull request #13643 from woocommerce/fix-13639
Force max to blank string when < 0
2017-03-17 15:36:35 +00:00
Mike Jolley 8d0a4a3caf Use correct getter in legacy API for get_discount
Fixes #13635
2017-03-17 14:37:19 +00:00
Mike Jolley e7397f96e7 Force max to blank string when < 0
Fixes #13639
2017-03-17 12:57:18 +00:00
Michael Pretty 1538eb9334 using old array constructor for older PHP support 2017-03-16 17:38:18 -04:00
Michael Pretty 980500c353 Preventing the instance Data Store from being serialized with the containing WC_Data object 2017-03-16 17:23:06 -04:00
Claudio Sanches 1aa8218b26 Fixed oauth signature replacing spaces by plus sign
oAuth signatures are encoded by base64, that can generate plus signs.
See RFC 4648 <http://www.rfc-editor.org/rfc/rfc4648.txt>

By default plus signs in query params are replaced into spaces while
trying to access by super globals like $_GET and $_POST

Closes #13615
2017-03-16 14:23:45 -03:00
Mike Jolley adfd955194 Merge pull request #13619 from woocommerce/fix-13618
Remove add to cart from referer
2017-03-16 16:47:17 +00:00
Mike Jolley a2d98883cd SQL should use = not IN
fixes #13616
2017-03-16 12:51:48 +00:00
Mike Jolley 5440a45587 Remove add to cart from referer
Fixes #13618
2017-03-16 11:18:15 +00: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 544060c0f2 Updated upgrade script from 2.7 to 3.0 2017-03-15 13:55:07 -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 eba500d96a array spacing 2017-03-15 16:08:23 +00:00
Mike Jolley 0f2f1699dc Spacing 2017-03-15 16:08:10 +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 943c507d3f Merge pull request #13606 from woocommerce/fix-13525-api
Fix 13525 api
2017-03-15 15:43:45 +00:00
Claudio Sanches af9d0961fc Merge pull request #13605 from woocommerce/fix-13604
Load photoswipe template only when scripts and styles are loaded
2017-03-15 12:38:40 -03:00
Mike Jolley 77cade928a Merge pull request #13596 from woocommerce/fix/payment-token-crud-pattern
Update Payment Tokens to follow the same pattern for custom data as other objects.
2017-03-15 15:38:31 +00:00
Claudiu Lodromanean f151576410 Add missing docblock 2017-03-15 08:32:17 -07: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 6e73c9ddab Bring up to date with main branch 2017-03-15 08:22:26 -07:00
Justin Shreve b917a87a73 Deprecated $context on get_display_name. 2017-03-15 08:21:02 -07:00
Claudiu Lodromanean 9703af350d Use correct legacy date format 2017-03-15 08:19:17 -07:00
Claudiu Lodromanean 0bbce21fd2 Line up whitespace 2017-03-15 08:13:06 -07:00
Claudiu Lodromanean bbfea35cf0 API tweaks from feedback 2017-03-15 08:10:42 -07:00
Claudiu Lodromanean 6fffb10e47 Merge remote-tracking branch 'origin/fix-13525' into HEAD 2017-03-15 07:42:24 -07:00
Claudiu Lodromanean 111246771c Use date_expires meta key 2017-03-15 07:38:57 -07:00
Mike Jolley deda0f21e9 Load photoswipe template only when scripts and styles are loaded 2017-03-15 13:36:11 +00:00
Boro Sitnikovski 74388dafbf Do not pass `true` to `update_post_meta` as prev value. 2017-03-15 14:33:24 +01:00
Mike Jolley 20b857bfbf Merge pull request #13602 from JeroenSormani/fix-false-deprecated
Remove @(deprecated) sign from docblock to prevent false notice in ed…
2017-03-15 09:55:13 +00:00
JeroenSormani 08e441149b Remove @(deprecated) sign from docblock to prevent false notice in editors 2017-03-15 09:46:17 +01:00
Claudiu Lodromanean 4483c292ba Missed a break 2017-03-14 16:04:34 -07:00
Claudiu Lodromanean 6351bb0c22 Update coupon API 2017-03-14 16:00:15 -07:00
Claudiu Lodromanean 51b7110de2 Update API v2 2017-03-14 14:43:53 -07:00
Claudiu Lodromanean cb3568add9 Add new meta key to internal meta keys 2017-03-14 14:14:07 -07:00
Claudiu Lodromanean f4d012cf00 Wrong branch
This reverts commit 983896cb8b.
2017-03-14 13:27:40 -07:00
Claudiu Lodromanean 983896cb8b Update v2 coupon api 2017-03-14 13:25:45 -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
Mike Jolley 071d389c73 Merge pull request #13595 from woocommerce/13527-wp-api
Included access_expires_gmt to customer downloads endpoint v2
2017-03-14 19:21:08 +00:00
Claudio Sanches 1b1fc109f7 Included access_expires_gmt to customer downloads endpoint v2 2017-03-14 16:04:22 -03:00
Claudio Sanches 137de9eea6 Fixed access_expires in legacy REST API 2017-03-14 15:40:36 -03:00
Mike Jolley 7baf3ddc1c Remove the clear code and property from woocommerce_form_field
Fields can be sorted dynamically with JS, so the clear div will never
move with it and cannot be output reliably.

Clearing should be done with CSS.
2017-03-14 17:49:42 +00:00
Claudiu Lodromanean 62d00ff950 Return offset timestamp not utc in legacy 2017-03-14 10:39:37 -07:00
Claudiu Lodromanean 3476121709 Use local time where appropriate 2017-03-14 10:27:48 -07:00
Mike Jolley a3cc5cc9bb has_meta -> meta_exists
#13590

Avoid has_meta conflict with old method.

#13581
2017-03-14 16:49:13 +00:00
Mike Jolley 1740f1e3e8 Merge pull request #13590 from woocommerce/fix-13581
Add a has_meta method to WC_Data
2017-03-14 16:42:40 +00:00
Mike Jolley b7579b2686 Merge pull request #13589 from woocommerce/fix-13578
get_formatted_meta_data should ignore meta with no ID
2017-03-14 15:58:26 +00:00
Claudiu Lodromanean 76536688e2 Use utc time for expiry box 2017-03-14 08:17:53 -07:00
Claudiu Lodromanean f042305ff7 Update date_expires meta handling 2017-03-14 08:10:31 -07:00
Mike Jolley a0c160f6e9 Merge branch 'pr/13558' 2017-03-14 12:35:19 +00:00
Mike Jolley 49b782d20e Correct formatting 2017-03-14 12:34:20 +00:00
Mike Jolley a9e224fa78 Wrap rating with esc_html 2017-03-14 12:32:34 +00:00
Mike Jolley 9d7c5cee39 Work around legacy has_meta method for orders 2017-03-14 12:25:39 +00:00
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
Claudiu Lodromanean d0f47a7980 Revert to original behavior 2017-03-07 13:17:36 -08:00
Claudiu Lodromanean 955a75bf30 Fix changes and more tests 2017-03-07 11:58:02 -08:00
Claudiu Lodromanean 2436541fff Fix individual use coupon handling 2017-03-07 11:31:20 -08:00
Mike Jolley 396985ec84 Merge pull request #13500 from aristath/phpcs-fix
PHPCS fixes
2017-03-07 18:01:05 +00:00
Aristeides Stathopoulos 70ee7ae7ea Fix some PHPCS errors 2017-03-07 19:57:28 +02:00
Claudiu Lodromanean dd97b7bc50 Allow product ids in get_product_data 2017-03-07 09:40:28 -08:00
Mike Jolley d5262a1711 Merge pull request #13497 from woocommerce/fix-13496
Remove filter in maybe_set_date_paid to avoid infinite loop
2017-03-07 17:18:04 +00:00
Claudio Sanches 1e576133b1 Merge pull request #13493 from woocommerce/fix-13489
Multiple arguments passed to isset must all be isset to be true. We need 'or'.
2017-03-07 13:01:03 -03:00
Mike Jolley be0a8d2c87 Remove filter in maybe_set_date_paid to avoid infinite loop
Fixes #13496
2017-03-07 14:45:42 +00:00
Mike Jolley ffa0bcc2bb Pass $this to woocommerce_payment_complete_order_status filter 2017-03-07 14:39:07 +00:00
Mike Jolley 578f89812c Use set_date_paid directly 2017-03-07 14:37:45 +00:00
Mike Jolley 5bdeddcb32 Hide suffix on variable product when dynamic.
Closes #13494
2017-03-07 13:25:52 +00:00
Mike Jolley 3eea782750 Brackets 2017-03-07 12:45:35 +00:00
Mike Jolley 3073867449 Multiple arguments passed to isset must all be isset to be true. We need 'or'.
Fixes #13489
2017-03-07 12:44:30 +00:00
Mike Jolley ce6c4a736f Merge pull request #13488 from woocommerce/downloads-consistency
Downloads data consistency
2017-03-07 12:13:03 +00:00
Mike Jolley 16b0aa9a52 Merge pull request #13487 from woocommerce/exclude-customer-internal-meta-data
Prevent update or list _order_count and _money_spent on WC_Customer_Data_Store
2017-03-07 10:29:34 +00:00
Mike Jolley 7940975f78 Merge pull request #13486 from woocommerce/coupons-consistency
Fixed coupons consistency with docblocks and REST API
2017-03-07 10:28:37 +00:00
Claudio Sanches df1a87a749 [REST API] Removed extra product_name in v1 and added schema for product_name in v2 2017-03-06 19:48:26 -03:00
Claudio Sanches a10fa76438 Fixed empty file object in downloads data and removee extra download_name 2017-03-06 19:45:03 -03:00
Claudio Sanches 64b45e9909 Prevent update or list _order_count and _money_spent on WC_Customer_Data_Store 2017-03-06 19:03:26 -03:00
Claudio Sanches 50d62a5c4c REST API v1 should return 0 when limit_usage_to_x_items is empty 2017-03-06 18:14:32 -03:00
Claudio Sanches de77bddcfb limit_usage_to_x_items should be integer 2017-03-06 18:14:15 -03:00
Justin Shreve 71d3308401 Show a reminder to include a valid --user flag when an authentication error is returned by the CLI.
Adds an additional message when the REST API returns 401 errors to the CLI, so that people properly include the `--user` flag.

To test:
* Run a command without a valid user ID (`wp wc product list`).
* See the additional error message.
* Run a command with a valid user ID, but cause another error, like a product not existing. (`wp wc product get 124124124 --user=1`).
* See that the extra error message is not displayed.
2017-03-06 11:34:06 -08:00
Mike Jolley 296daf19c2 Avoid wc_clean
Fixes #13464
2017-03-06 14:53:32 +00:00
Mike Jolley e5ed116e33 Split total row methods to avoid calling total row filter twice
Fixes #13456
2017-03-06 13:44:52 +00:00
Claudio Sanches 8a77bb0957 Fixed undefined $id #13405 2017-03-04 12:15:52 -03:00
Claudiu Lodromanean e4db7f1d76 Update variable names to correct ones 2017-03-03 14:40:31 -08:00
Claudio Sanches 7adb472a1c Fixed extra argument on array_map while setting categories and tags ids 2017-03-03 16:26:57 -03:00
Claudio Sanches 8d28e966c4 Let product CRUD handle terms IDs 2017-03-03 16:21:27 -03:00
Claudio Sanches a4b7cc5f0d Accept only list of terms IDs for product categories and tags 2017-03-03 16:19:32 -03:00
Claudio Sanches ee276e10a4 Merge pull request #13460 from woocommerce/fix-13458
Set line item prices on legacy API order create
2017-03-03 15:45:53 -03:00
Claudiu Lodromanean 51c5910866 Set line item prices on legacy API order create 2017-03-03 09:26:08 -08:00
Justin Shreve dc501dc3be Fix CLI notice when using --fields.
A non-existent variable was being passed to `limit_item_to_fields`, causing a PHP notice to be displayed.
`PHP Notice:  Undefined variable: fields in includes/cli/class-wc-cli-rest-command.php on line 183`

This PR passes the correct value.

To Test:

1. Use `wp wc product list --user=1 --fields="sku,name"` on the command-line.
2. Make sure that a PHP notice does not display in your debug log.
2017-03-03 08:55:22 -08:00
Mike Jolley 2b5bdaa15d Remove unused variable 2017-03-03 13:31:27 +00:00
Mike Jolley 09de226bd2 Fix error checking on endpoints to prevent fatal errors
Fixes #13453
2017-03-03 13:18:07 +00:00
Mike Jolley 9c988b3412 Merge branch 'master' into fix#13454 2017-03-03 10:52:14 +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
Mike Jolley 0a53e0e47f Merge pull request #13444 from woocommerce/fix-13420
Set date paid for old orders
2017-03-03 10:41:33 +00:00
faisal-alvi 8b579bb820 fix#13454 2017-03-03 15:18:59 +05:30
Claudio Sanches f7d8ddffab Merge pull request #13452 from woocommerce/fix-13405
Legacy API tweaks
2017-03-02 22:42:46 -03:00
Claudiu Lodromanean bd4458fa90 Change create to save 2017-03-02 14:28:35 -08:00
Claudio Sanches 29318f85a6 Merge pull request #13451 from thenbrent/fix_undefined_var
Fixes for $order_url variable
2017-03-02 19:17:01 -03:00
Claudio Sanches 7b77a9fd2e Merge pull request #13449 from woocommerce/fix-13427
get_meta should return empty array sometimes
2017-03-02 19:15:00 -03:00
Brent Shepherd 759de5cc00 Fix undefined $order_url variable
In the case of an order with no items.

Fix redundantly setting the $order_url multiple times in the case
of orders with more than one line item.
2017-03-02 13:09:38 -08:00
Claudio Sanches 3aa86075d1 Prevent errors when do not have a paid date 2017-03-02 16:29:04 -03:00
Claudiu Lodromanean d5fd1e46ee get_meta should return empty array sometimes 2017-03-02 11:16:49 -08:00
Claudio Sanches 9fb2ba7783 [REST API] date_paid should be in date time format, closes #13255 2017-03-02 15:25:32 -03:00
Mike Jolley 35eea95550 Set date paid for old order 2017-03-02 17:47:28 +00:00
Mike Jolley c76c2d1a8d Merge pull request #13442 from woocommerce/fix-13419
Update date created/modified if changed.
2017-03-02 17:39:45 +00:00
Mike Jolley 1a8737fdeb Standardize cache group names 2017-03-02 17:15:39 +00:00
Mike Jolley 200f4c7741 Merge pull request #13414 from woocommerce/fix-13400
Dont save empty text attributes
2017-03-02 16:52:34 +00:00
Mike Jolley 0b0066b2a0 Merge pull request #13424 from woocommerce/fix/reintroduce-virtual-coupons
Reintroduce virtual coupons by "un"deprecating the filter.
2017-03-02 16:52:24 +00:00
Claudio Sanches 6dad909570 Merge pull request #13425 from woocommerce/fix-13411
Dont render empty stock descriptions
2017-03-02 13:49:12 -03:00
Mike Jolley fd07d06825 Update date created/modified if changed.
Fixes #13419
2017-03-02 16:46:59 +00:00
Claudiu Lodromanean 3f1d538878 Single quotes instead of double 2017-03-02 08:45:01 -08:00
Claudiu Lodromanean 36a8d08a5f Tweak no-availability check 2017-03-02 08:30:01 -08:00
Claudiu Lodromanean 527fb42771 Refactor empty option check 2017-03-02 08:21:20 -08:00
Mike Jolley 5637f043e5 Fix term name in update function
Closes #13398
2017-03-02 15:59:22 +00:00
Mike Jolley 2e56114d8e Fix styling of variation upsells 2017-03-02 15:33:08 +00:00
Mike Jolley 0dfab8326b Backwards compatibility for woocommerce_upsell_display_args 2017-03-02 15:29:15 +00:00
Mike Jolley 793b2dfa69 woocommerce_upsells_total filter.
Closes #13436
2017-03-02 15:15:41 +00:00
Mike Jolley c29f6bba50 Merge pull request #13408 from woocommerce/fix-13396
Better invalid data store handling
2017-03-02 12:46:51 +00:00