Commit Graph

809 Commits

Author SHA1 Message Date
Mike Jolley 938361535f Exception handling 2016-08-24 16:02:19 +01:00
Mike Jolley cde78abed3 Working on catching errors 2016-08-24 15:26:35 +01:00
Mike Jolley d9798f7226 Set reading to prevent exceptions during DB load 2016-08-24 14:37:19 +01:00
Mike Jolley 7e30e8dda3 Set defaults and handle order reads without exceptions 2016-08-24 12:34:19 +01:00
Mike Jolley 53f01b52a8 Bring back WC_Data_Exception 2016-08-24 10:46:29 +01:00
Mike Jolley b727acd96e Implement get and set prop methods 2016-08-23 18:48:48 +01:00
Mike Jolley e08e5a816d 2d array handling 2016-08-23 15:49:34 +01:00
Mike Jolley 2636d04ba6 Setters 2016-08-23 15:25:50 +01:00
Mike Jolley 3e3e35d50d Add set prop/get prop helper, error handler, and validation to item product class 2016-08-23 14:58:44 +01:00
Mike Jolley 74c96e305b Error method 2016-08-23 13:43:26 +01:00
Claudio Sanches 7a0c5bc19b REST API expect meta data ID as an integer value
cc @mikejolley
2016-08-22 16:59:03 -03:00
Claudio Sanches 38e1be71eb ID first for all elements in the REST API
cc @mikejolley
2016-08-22 16:58:34 -03:00
Mike Jolley 39f4a1cdca Swaps meta_id for id across crud and api 2016-08-22 19:37:34 +01:00
Mike Jolley a8e47992a6 Put back add_product for convenience. Fix unit tests. 2016-08-22 18:00:52 +01:00
Mike Jolley 95b11606fc get_product_from_item -> get_product 2016-08-22 16:51:24 +01:00
Mike Jolley c88984eb0e Replace add methods 2016-08-22 16:48:19 +01:00
Mike Jolley fc2e039882 Deprecate add_product etc
#11601
2016-08-22 14:51:53 +01:00
Mike Jolley fdd7e797ba API get refunds 2016-08-22 13:15:15 +01:00
Mike Jolley 9e45927803 Create refund with crud 2016-08-22 13:15:15 +01:00
Mike Jolley 21ad196297 Use CRUD in wc_save_order_items 2016-08-19 13:43:33 +01:00
Mike Jolley 594bceedf2 Comment out exception code - see #11715 2016-08-17 17:07:30 +01:00
Mike Jolley 709dec9ef1 Create and update handling 2016-08-17 16:53:01 +01:00
Mike Jolley 0b9a5998cc Exception class 2016-08-17 11:44:56 +01:00
Mike Jolley 99be0167b4 Order type doesn't appear to be used anywhere, and I'd expect other plugins extending orders to have their own classes anyway making this a bit pointless.
@thenbrent
2016-08-16 13:02:22 +01:00
Mike Jolley 1baef12395 qty -> quantity 2016-08-16 12:36:38 +01:00
Mike Jolley bc75c60227 Merge branch 'master' into order-crud-api 2016-08-16 11:09:14 +01:00
Mike Jolley c7ae2c31ea leave wp meta alone and handle serialisation 2016-08-15 17:37:18 +01:00
Mike Jolley 3f08d116d8 Start using crud for order requests 2016-08-15 17:27:33 +01:00
Mike Jolley 83dca89d0c Correct customer escaping and tests 2016-08-15 16:53:48 +01:00
Mike Jolley e1318d9175 Stop WP core meta data being removed for customers
@justinshreve
2016-08-15 13:17:43 +01:00
Mike Jolley 0113dbd7c5 Use wc_do_deprecated_action 2016-08-15 11:08:36 +01:00
Mike Jolley 0dd41179aa Prefix item ids and revert some changes to add_products method for ease of use. 2016-08-15 11:02:25 +01:00
Mike Jolley 7796fe9cf1 Clean item/group cache when remove_order_items is used. 2016-08-12 16:48:48 +01:00
Mike Jolley eec9ce5b41 Revert addition of _delete_extra_meta_data
This essentially removes the ability to delete meta which is not great.

@justinshreve you added this in
https://github.com/woothemes/woocommerce/commit/e3b1f6dbc9558bae606fa76e
6941175582a301b7 - can you tell me what problems it was causing you so
we can add a different fix if needed?
2016-08-12 16:41:06 +01:00
Mike Jolley 30b0045d8a Fix more notices 2016-08-09 14:30:10 +01:00
Mike Jolley 71afe5fdf7 Fix get_items 2016-08-09 14:21:54 +01:00
Mike Jolley f4a4f6c361 Reduce stock and other notices 2016-08-09 14:15:04 +01:00
Mike Jolley 8d58febaf8 Merge branch 'master' into orders-crud-function-update
# Conflicts:
#	includes/class-wc-checkout.php
2016-08-09 14:03:06 +01:00
Mike Jolley 7861b76e9b Checkout handling
Also introduces add_item so you can add items to an order before the
order exists. Save at once is more efficient.
2016-08-09 14:02:40 +01:00
Mike Jolley 4ac4bcaa08 Merge branch 'master' into WC-CRUD
# Conflicts:
#	tests/unit-tests/cart/cart.php
2016-08-09 11:08:21 +01:00
Justin Shreve fe7e26d68d Error fixes:
* Typos
* Consistent edit error handles
* Consistent error messages
2016-08-08 14:52:46 -07:00
Mike Jolley 971cff77b8 Fixed unit tests 2016-08-08 17:47:50 +01:00
Mike Jolley 39eb584321 Merge branch 'master' into orders-crud-function-update 2016-08-08 17:24:40 +01:00
Mike Jolley e8d85005d7 Handle default status 2016-08-08 17:24:39 +01:00
Mike Jolley 9d66367699 Status change fixes 2016-08-08 17:03:43 +01:00
Mike Jolley a8759fc0aa Meta/product handling 2016-08-08 16:20:15 +01:00
Mike Jolley 4a8db96c91 [2.6][api] ID needs to be capitalized
Sorting won’t work with lowercase id

Fixes #11635

@claudiosmweb
2016-08-08 12:10:29 +01:00
Paul Kilmurray 4484877481 initialize $tax_rates variable
There are situations where the $tax_rates may not be initialized in the conditional, which in turn throws an error later in the function.
2016-08-08 10:36:04 +07:00
Mike Jolley 1c592b3872 Merge pull request #11208 from woothemes/orders-crud-classes
Orders crud classes
2016-08-05 15:44:15 +01:00
Mike Jolley 0b04ee195c Over sanitization 2016-08-05 15:43:12 +01:00
Justin Shreve e3b1f6dbc9 A few fixes to customer CRUD:
* Implement some missing legacy functions
* Stop calling legacy functions from some pages
* Prevent extra meta from being deleted, unless requested by the CRUD (was causing problems with user/customer)
* Prevent save when loading from session AND logged out
2016-08-04 13:13:07 -07:00
Mike Jolley b0963ddb0d Merge pull request #11176 from woothemes/add/10954-shipping-zones-api
Add Shipping Zones API Endpoints.
2016-08-04 15:45:23 +01:00
Mike Jolley 387cd745c2 Add missing textdomains 2016-08-04 14:43:34 +01:00
Mike Jolley 1bc9da3e91 Merge branch 'master' into WC-CRUD
# Conflicts:
#	includes/class-wc-coupon.php
2016-08-04 12:10:04 +01:00
Mike Jolley 5a9dacd595 Show variable weights/dimensions even when parent values are not set. 2016-08-03 16:07:34 +01:00
Mike Jolley f694f297e8 Use get_id() 2016-08-03 12:57:32 +01:00
Mike Jolley 1310ff09b5 Deprecated function replacements 2016-08-03 12:52:45 +01:00
Mike Jolley 837e08143b Merge branch 'master' into orders-crud-classes
# Conflicts:
#	includes/abstracts/abstract-wc-order.php
2016-08-03 12:32:27 +01:00
Justin Shreve 9396c5436b Make sure that the create shipping zone uses the correct permissions function. Also makes sure creating the shipping zone returns 201, with the location of the new entity, like other endpoints. 2016-08-02 10:26:26 -07:00
Justin Shreve 33e0b367ac Add new line at end of files. 2016-08-02 10:10:47 -07:00
Jeff Stieler 288496b22b Separate shipping zone endpoint permissions check between read and write operations. 2016-08-02 10:10:47 -07:00
Jeff Stieler 56ef442624 Move common methods to an abstract base shipping zones controller class. 2016-08-02 10:10:47 -07:00
Mike Jolley 423a18f5c1 [2.6] When checking needs_shipping, ignore anything after : in the method ID
Fixes #11552
2016-08-01 10:31:05 +01:00
Nicola Mustone 5613985882 Capitalise all the things 2016-07-26 15:47:04 +02:00
Mike Jolley 9b60e0543f Allow meta_key/value in rest api filter
@claudiosmweb Closes #11518
2016-07-25 13:12:39 +01:00
Mike Jolley bc80b75540 Merge pull request #11324 from woothemes/out-of-stock-threshold-11322
Out of stock threshold 11322
2016-07-20 14:44:41 +02:00
Mike Jolley e5634c6946 Do not sanitize passwords
Closes #11473
@claudiosmweb
2016-07-19 16:43:15 +01:00
Claudio Sanches 7778583340 Fixed wrong number of decimal precision, closes #11368 2016-07-11 17:26:54 +02:00
Sven Wagener d5a414d0e3 Instance ID have to be checked, because on using settings and instace settings together every time the instance settings will be fetched. 2016-07-05 21:03:18 +02:00
Paul Kilmurray 75379a6025 fix typo
#11349
2016-07-05 11:44:22 +08:00
Claudio Sanches 6fafe2c531 Fixed how calculate shipping tax rates when using more than one tax class
Closes #11349

cc @mikejolley
2016-07-04 17:52:53 -03:00
Claudio Sanches 8f62c322dd [REST API] Fixed check for product types, closes #11341 2016-07-04 17:24:39 -03:00
Mike Jolley c495552301 Same for variations 2016-07-01 12:01:37 +01:00
Mike Jolley 6422669c95 Base is_in_stock purely on stock status and not stock levels 2016-07-01 11:59:52 +01:00
Claudio Sanches 69b976e3a9 [REST API] Remove the term if something fails while creating, closes #11303 2016-06-30 15:24:23 -03:00
Mike Jolley a9918043b9 Only show available on backorder if notifying customer 2016-06-29 15:51:20 +01:00
Mike Jolley b11794ceac @Since changes 2016-06-29 12:58:38 +01:00
Mike Jolley adf0c2152e Fix - Don't sync ratings right away; meta won't exist in some cases. 2016-06-28 15:24:37 +01:00
Mike Jolley 5275a2663a check if empty 2016-06-23 16:07:35 +01:00
Mike Jolley a22859ae32 Abstract unit tests 2016-06-23 15:52:12 +01:00
Mike Jolley a2b8352081 Merge branch 'pr/11229' 2016-06-23 11:44:12 +01:00
Mike Jolley dd48f3e851 Do away with ID - $this covers everything 2016-06-23 11:44:04 +01:00
Mike Jolley 3334693885 Revised stock display based on feedback to hide 'in stock' message if stock management is off.
@claudiosmweb This removes ‘in stock’ when not needed, and I broke the
methods up for clarity.

Also removed the variation specific logic as it was near identical and
not needed.
2016-06-23 11:24:15 +01:00
Alexandre Sorochan ff003f066c Filter for backorders
It's possible to change backorder status using filters via `woocommerce_product_backorders_allowed`.
However, it's not possible to set `$product->backorder` to `"notify"`.
Added a filter similar to `woocommerce_product_backorders_allowed`
2016-06-23 09:55:19 +02:00
Mike Jolley 46439ddba5 Refund unit tests 2016-06-22 16:31:05 +01:00
Mike Jolley 8287b13cf1 Address and CRUD unit tests 2016-06-22 14:07:42 +01:00
Mike Jolley 972442b1ae Merge branch 'master' into orders-crud-classes 2016-06-22 11:59:26 +01:00
Mike Jolley 4ddf220b9b Pass $this to backorder filter.
Closes #11216
2016-06-22 11:56:43 +01:00
Mike Jolley fe3e61b754 Legacy order class 2016-06-21 20:04:49 +01:00
Mike Jolley 122ad3a479 Abstract order class 2016-06-21 20:03:56 +01:00
Claudio Sanches 57e041a58f [2.6] [REST API] Fix warnings when product is not hierarchical, closes #11192 2016-06-20 17:29:56 -03:00
Claudio Sanches 11534cf457 [2.6] [REST API] Allow fetch, edit and delete a single product variation 2016-06-20 15:49:43 -03:00
Claudio Sanches cdd4e6d877 [2.6] Fixed notices when do not include "default" in shipping instance fields
Notice: Undefined index: default in wp-includes/functions.php on line 3463

cc @mikejolley
2016-06-18 10:21:09 -03:00
Mike Jolley 52ff42d3ad Fix available check for legacy methods 2016-06-17 16:20:44 +01:00
Claudio Sanches 56e6429940 Restore the WC_Settings_API::init_form_fields() method 2016-06-14 19:00:18 -03:00
Mike Jolley 78142a8ebb Merge branch 'master' into WC-CRUD
# Conflicts:
#	includes/class-wc-checkout.php
#	includes/class-wc-coupon.php
#	includes/class-wc-customer.php
#	tests/unit-tests/cart/cart.php
#	tests/unit-tests/cart/functions.php
#	tests/unit-tests/coupon/coupon.php
#	woocommerce.php
2016-06-13 15:01:58 +01:00
Mike Jolley 847dea6a2d docs/vars 2016-06-07 14:02:02 +01:00
Mike Jolley 77eca1da3f docblock fix 2016-06-07 11:06:41 +01:00
Mike Jolley d70cfa0c74 white space issues 2016-06-06 20:04:45 +01:00
Mike Jolley 119b53c383 fix comments 2016-06-06 19:52:51 +01:00