Commit Graph

302 Commits

Author SHA1 Message Date
Mike Jolley 1b2df3dd3b Merge branch 'pr/11797'
# Conflicts:
#	includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php
#	includes/api/class-wc-rest-coupons-controller.php
#	includes/class-wc-coupon.php
#	tests/unit-tests/api/coupons.php
#	tests/unit-tests/coupon/crud.php
2016-09-01 11:46:05 +01:00
Claudio Sanches 06280a7003 HTTPS for google maps 2016-08-31 14:18:55 -03:00
Aristeides Stathopoulos 17961f6484 WordPress.Arrays.ArrayDeclaration.ValueNoNewline 2016-08-27 06:04:10 +03:00
Aristeides Stathopoulos b063bcfe4c last item in a multiline-array should end in a comma 2016-08-27 04:46:45 +03:00
Mike Jolley 9bd57414c5 Remove set and get prop - no longer need the extra overhead since functions won't return wp_error now. 2016-08-26 10:48:17 +01:00
Mike Jolley 461ec4da16 Return false instead of throwing exception 2016-08-25 17:48:36 +01:00
Mike Jolley 658970cbc8 No string required here 2016-08-25 17:12:32 +01:00
Mike Jolley 3637814b92 Revert use of default_data for default args and just set that in constructor 2016-08-25 13:31:03 +01:00
Mike Jolley 25883f8687 Set_props helper to load data from DB and handle errors 2016-08-25 13:05:27 +01:00
Mike Jolley 938361535f Exception handling 2016-08-24 16:02:19 +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 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 1baef12395 qty -> quantity 2016-08-16 12:36:38 +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
Mike Jolley b11794ceac @Since changes 2016-06-29 12:58:38 +01:00
Mike Jolley 46439ddba5 Refund unit tests 2016-06-22 16:31:05 +01:00
Mike Jolley 9da9d3bf69 Unit test conditional functions 2016-06-22 15:38:28 +01:00
Mike Jolley 8287b13cf1 Address and CRUD unit tests 2016-06-22 14:07:42 +01:00
Mike Jolley ece2b5bf57 Order class 2016-06-21 20:06:39 +01:00
Mike Jolley ee0798047e Merge branch 'wc-get-orders-10500' 2016-03-14 16:09:01 +00:00
Mike Jolley 733b0c8c93 Lowercase includes %s string only 2016-03-14 10:41:48 +00:00
Mike Jolley c1e8dd1fe8 Use wc_get_orders iternally 2016-03-09 16:11:05 +00:00
Mike Jolley 37003b2370 Round get_remaining_refund_amount
Fixes #10060
2016-01-13 11:07:05 +00:00
Mike Jolley 2e553cf220 Show order refunds in totals
Fixes #9589 @claudiosmweb
2015-11-30 15:25:48 +00:00
Nicola Mustone c9da4f928a check if ABSPATH is defined 2015-11-06 10:22:19 +01:00
Scrutinizer Auto-Fixer 08efaf84df Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-11-05 16:05:03 +00:00
Claudio Sanches 5893875b0c Removed period for file headers 2015-11-03 11:53:50 -02:00
Claudio Sanches ee30b5b308 Fixed php docs standards 2015-11-03 11:31:20 -02:00
Mike Jolley abaa8f47d8 Moved refund hooks to avoid emails after API refund failure 2015-10-06 14:43:36 +01:00
Ewout Fernhout 535949b02e add $display_refunded parameter to get_formatted_order_total
#8793
2015-08-13 15:45:49 +02:00
Mike Jolley 7b2aec4791 Take item qty into consideration when refunding orders
Fixes #8675
2015-07-29 13:13:41 +01:00
Mike Jolley 7285ce74e6 Tax display notice 2015-07-16 10:15:45 +01:00
Mike Jolley db473cc369 Move refund logic into main order class.
These methods are not defined in the abstract.
2015-07-15 16:02:26 +01:00
Mike Jolley b9708c4df9 Show refunded total shipping and taxes
Closes #8222
2015-06-01 11:06:11 +01:00
Mike Jolley efb8be72c2 Round tax total 2015-05-01 14:57:56 +01:00
Claudio Sanches def250e912 Display taxes labels in order totals when order has refunded, closes #7229 2015-01-29 18:50:08 -02:00
Mike Jolley e03cf9c204 Set order_type property, and move actual order loading to separate method to make it easier for sub-classes to handle just that process.
Closes #6513
2014-10-14 14:25:53 +01:00
Nick Ivanter 3fcae6e63f Allow WC_Order to be constructed w/o Order ID
This was allowed in WooCommerce 2.1 and some plugins rely on this behavior. Also, there seems to be no downside, as the parent class WC_Abstract_Order similarly doesn't require an Order ID at construction.
2014-09-22 14:58:18 +04:00
shivapoudel 5f05a78669 Line and indendation fix 2014-09-21 00:39:33 +05:45
Mike Jolley c4ef86d44e scrutinizer patches 2014-09-08 00:37:55 +01:00
Mike Jolley 5e663a7fa8 Show refunded line items inline 2014-07-25 16:48:19 +01:00
claudiosmweb 7328212c03 fixed the get refunds method 2014-07-24 12:09:03 -03:00
claudiosmweb ef445aa1d7 removed a test ¬¬ 2014-07-21 00:00:18 -03:00
claudiosmweb 299c12bd57 fixed order get_total_refunded() method 2014-07-20 23:48:23 -03:00
Mike Jolley 755001f19b Use order types where required 2014-07-11 12:43:42 +01:00
claudiosmweb 31a8483b4f created method to get the total amount already refunded 2014-07-08 16:59:38 -03:00
claudiosmweb 7d340abd6d fixed the get_refunds() method in WC_Order class 2014-07-08 16:41:03 -03:00
claudiosmweb 235deeacfe created get_refunds() method for WC_Order class 2014-07-08 15:23:22 -03:00
Coen Jacobs 86a4add087 Merge remote-tracking branch 'upstream/master' into order-factory-refactor
Conflicts:
	includes/class-wc-order.php
2014-07-03 13:38:55 +02:00
Mike Jolley 529b471470 Merge pull request #5771 from helgatheviking/fix/order-add_product-meta
wc_add_order_item_meta() the _line_total doesn't use the correct total
2014-07-02 13:58:48 +01:00
Mike Jolley 101254a6a3 Have get_product_from_item only return variable product if it exists, and show on the order item row if the variation no longer exists.
Fixes #5536
2014-07-02 13:58:10 +01:00
Kathy Darling cf322e9625 wc_add_order_item_meta() the _line_total doesn't use the total 2014-07-01 10:48:30 -04:00
Mike Jolley 779613b062 Merge pull request #5660 from tamarazuk/upstream
Introduce 'woocommerce_get_order_item_totals_excl_free_fees' filter
2014-06-30 12:00:25 +01:00
Mike Jolley 50a4c5bd23 Merge branch 'variation-stock-management'
Conflicts:
	includes/class-wc-product-variation.php
2014-06-27 11:15:42 +01:00
Mike Jolley 0f6f04e017 Added wc_stock_amount() core function and replaced intval
#4612
2014-06-25 11:25:28 +01:00
Mike Jolley 85befad283 Use max() to prevent division by zero Closes #5696 2014-06-23 12:56:11 +01:00
Mike Jolley cf3cca4c8e Merge branch 'feature-wc-create-order' 2014-06-18 16:07:29 +01:00
Mike Jolley 94549e1462 Notices 2014-06-13 16:11:15 +01:00
Mike Jolley 93778e72b0 Tax class fixes + notices 2014-06-13 15:53:59 +01:00
Mike Jolley 0f22691767 Calculate tax and totals methods 2014-06-13 15:21:15 +01:00
Coen Jacobs 476870d9f2 Created WC_Abstract_Order, extended by WC_Order 2014-06-13 15:37:20 +02:00
Mike Jolley 76d160c8fc Fire action when adding product 2014-06-13 10:20:38 +01:00
Mike Jolley a6da6e3353 Also use qty 2014-06-13 10:18:03 +01:00
Mike Jolley 5aa8b47c6b When setting totals, if not set get the data from the product 2014-06-13 10:14:18 +01:00
Mike Jolley 375a0e2652 static WC_Tax class - no need for a constructor in this 2014-06-12 16:47:43 +01:00
Tamara Zuk ee5d294ed7 Introduce 'woocommerce_get_order_item_totals_excl_free_fees' filter
The new filter will allow plugins that add order item meta to choose to
display the free fee items on order details pages and emails.
2014-06-11 19:16:27 -04:00
Mike Jolley 80ba9aa9c9 woocommerce_order_add_fee 2014-06-11 16:53:49 +01:00
Coen Jacobs 386751addf Support storing transaction id in payment_complete method 2014-06-11 16:36:32 +02:00
Mike Jolley ef3e728855 Setters + wc_create_order + wc_update_order for #4169 2014-06-11 15:10:03 +01:00
Coen Jacobs 3ad8935b20 Removed ununsed global variables in local scopes 2014-06-08 22:33:11 +02:00
Mike Jolley 32e77897cc Placeholder functions 2014-06-06 15:51:09 +01:00
Mike Jolley f30e95663b Prefixes for queries 2014-06-03 11:29:01 +01:00
Mike Jolley 9307fcf66b Internal wc- prefix and get_status filter 2014-06-03 11:04:56 +01:00
Mike Jolley 66f36d3f08 woocommerce_order_has_status filter 2014-06-03 10:47:16 +01:00
Mike Jolley 309f700283 has_status 2014-06-03 10:45:33 +01:00
Mike Jolley e0a74fffc4 implement is_status() 2014-05-30 17:43:21 +01:00
Mike Jolley fca32a98de Implement is_status functions and update_status 2014-05-30 17:16:22 +01:00
Mike Jolley 05b9b8af4e get_status_name + my_orders 2014-05-30 16:29:44 +01:00
Mike Jolley 3e687d2a6e Get status and is_status helpers which compare against post_status 2014-05-30 15:26:28 +01:00
claudiosmweb 96ea1d8bc4 introduces the WC_Order::needs_shipping_address() method 2014-05-28 16:20:36 -03:00
Coen Jacobs 6ab76b7ab0 Added parameter to get line subtotal filters 2014-05-26 16:44:36 +02:00
Manos Psychogyiopoulos 86b8e3e372 Add punctuation to fees 2014-05-14 18:22:55 +03:00
Mike Jolley 439ec0d4f6 Merge pull request #5425 from superdave2u/master
Updated the get_download_url() function - fixes #5424
2014-05-08 15:18:29 +01:00
Mike Jolley 3670afdffb [2.2] get_user and get_user_id methods
Closes #5429
2014-05-07 15:11:34 +01:00
Dave Mainville cabc84bf61 Closes #5424 2014-05-05 16:37:57 -04:00
Mike Jolley ca9955fa9a Update stock amounts with DB queries Closes #5367
@claudiosmweb and @coenjacobs please review
2014-04-25 15:28:02 +01:00
Mike Jolley 9b873093eb Check has_file when sending order emails for downloadables
Fixes #5296
2014-04-24 16:00:01 +01:00
Mike Jolley bf0fafa17b If billing email is not set and user ID is set, use email
Fixes #5356
2014-04-24 14:45:57 +01:00
Mike Jolley c09f710775 Merge pull request #5334 from ragulka/valid-order-statuses-improvements
Valid order statuses improvements
2014-04-23 15:07:15 +01:00
Illimar Tambek f07ff6acb5 Introduce `woocommerce_valid_order_statuses_for_payment_complete` filter
Since it's possible to filter the valid order statuses for payments and cancels,
it only makes sense to be able to do the same when checking which statuses
are valid for completing a payment.
2014-04-17 19:28:52 +03:00
Akeda Bagus 2a97f07d47 Typo fix. 2014-04-15 22:56:35 +07:00
Mike 16463e339e Change \WC_Order::add_order_note cap to edit_shop_order instead of manage_woocommerce 2014-04-03 14:33:54 +02:00
Mike Jolley 2f9860c583 Expanding line item_meta causes conflicts if attributes are named with things like 'name', 'type' or 'qty'. Added blacklist to exclude unsafe values. Closes #5100 2014-03-19 12:58:39 +00:00
justinstern 6dfce64e47 Don't trailingslash Order Cancel URLs with a Query String
With non-pretty permalinks enabled, this was producing a URI like
http://example.com/?page_id=7/  That final unnecessary trailing slash
messes up some redirect gateways that are passed the cancel URL
2014-03-11 00:04:49 -04:00
Mike Jolley 41183d1663 wc_delete_shop_order_transients functions and trigger when order status updates. Closes #4875 2014-02-26 15:43:19 +00:00
claudiosmweb bc98201d26 added the payment method title in order details, closes #4281 2014-02-15 03:14:04 -02:00
Mike Jolley 3bfbc9dfc5 Fix paypal shipping via text 2014-02-13 16:06:48 +00:00
Mike Jolley 767eba990d Return strings. Closes #4739 2014-02-12 12:21:36 +00:00
Coen Jacobs 9ae5cc5d8f get_subtotal_to_display docblock update. Closes #4693 2014-02-10 13:38:25 +01:00
Coen Jacobs 8b8cc20dab Merge pull request #4681 from thenbrent/master
Fix completing order payment for an order containing a deleted product
2014-02-10 10:30:01 +01:00
thenbrent 3187bfc32c Fix completing order payment for deleted product
When marking payment as complete on an order which contains a product which has
since been deleted, a fatal error will be thrown because the product is assumed
to exist.

The specific error is `PHP Fatal error: Call to a member function is_downloadable()`.
It occurs when checking if the order status should be set as completed or processing,
by determining if the product on the order is downloadable and virtual.

This patch will mark an order as "processing" if the product has since been deleted.
2014-02-08 11:37:21 -08:00
claudiosmweb 7dd98549d9 updated the WC_Order version to 2.1.0 2014-02-07 15:55:30 -02:00
claudiosmweb 93b5678617 fixed some coding standards in includes/class-wc-order.php 2014-02-07 15:55:07 -02:00
claudiosmweb 1c13e994de fixed the indentation in includes/class-wc-order.php 2014-02-07 15:41:28 -02:00
claudiosmweb 0d9752c04b fixed docblock for WC_Order::get_formatted_line_subtotal, closes #4667 2014-02-07 15:41:09 -02:00
Mike Jolley f46e6aefd7 Only show taxes in cart when taxes are enabled 2014-01-22 14:10:11 +00:00
Mike Jolley 858416605d Don't resort meta in admin 2014-01-07 10:38:28 +00:00
Mike Jolley cdb1ad5e9e On cancel, use cart page unless otherwise defined. Closes #4375 2013-12-30 14:09:50 +00:00
Gregory K 7b38c7300b Inconsistent return types: mostly TODOs, some fixes 2013-11-29 13:50:31 -05:00
Gregory K dd5a2fb334 PhpDocs 2013-11-27 13:20:31 -05:00
mihaigrigori b19fb1ee09 Explicit currency for order prices
Set the currency for the order prices to be the order's currency instead
of the shop's currency. When these are different, the order emails are
misleading.

Related to https://github.com/woothemes/woocommerce/pull/4143
2013-11-27 11:15:20 +02:00
Coen Jacobs 19688ad9ef Fixed several @return void clauses. There are more. No code changes in this commit, only PhpDocs
Closes #4216
2013-11-27 10:03:47 +01:00
Coen Jacobs 47ae00be28 Page functions woocommerce to wc refactor 2013-11-25 15:07:22 +01:00
Coen Jacobs c1a439eb99 Formatting functions woocommerce to wc refactor 2013-11-25 14:34:21 +01:00
Coen Jacobs aaa14894ca Core functions woocommerce to wc refactor 2013-11-25 13:45:04 +01:00
Mike Jolley 43807a0488 Accessing currency wrong 2013-11-20 17:25:48 +00:00
Mike Jolley 0dc0b9cbb0 Indenting fail. 2013-11-20 16:13:53 +00:00
mihaigrigori fac0bf69eb Show order currency
- method to return the order currency
- allow 'currency' parameter for 'woocommerce_price'
2013-11-19 15:13:11 +02:00
Mike Jolley 3fd02a57d0 Locales - store standardised values, and display using locale in admin #3862 2013-11-12 17:43:30 +00:00
Coen Jacobs c58621f3f8 Fixed docblock return type, closes #4057 2013-11-04 11:20:45 +01:00
Scott Basgaard ea03af2ee4 woocommerce_exclude_order_comments() is now exclude_order_comments() 2013-10-26 17:30:43 +02:00
Mike Jolley c7429357c7 Fix notices and rounding issues in orders 2013-10-25 20:02:21 +01:00
Mike Jolley dee6bba05c Fix get_item_subtotal 2013-10-25 13:25:53 +01:00
Mike Jolley 92fa4e379b round tax reports 2013-10-24 16:19:28 +01:00
Mike Jolley 51aba21d76 Rounding + precision for taxes. Store unrounded. Round down (for the moment) for taxes 2013-10-24 13:15:42 +01:00
Mike Jolley a112cb1d7d Consistant method names Closes #3901, return doubles instead of number formatted strings. 2013-10-17 12:43:44 +01:00
Mike Jolley 4cabf24422 needs_payment for 2.1 #3928 2013-10-16 14:14:15 +01:00
Bernard Peh ad298f9007 need $this->id check in the update_status function to prevent an empty WC_Order object from calling it. If $this->id doesn't exists, update_status will insert another row in wp_posts because line 1226: wp_update_post(array('ID' => $this->id)) triggers it. 2013-10-10 20:52:36 +11:00
Illimar Tambek bf6cb38445 Fix has_shpping_method function 2013-10-03 18:02:26 +03:00
Illimar Tambek 7cf58f920c Add method to check whether an order has a shipping method or not 2013-10-03 17:59:08 +03:00
Mike Jolley c20a44c423 Coupon usage limits per user (using email + ID). Closes #3314 2013-10-01 11:48:27 +01:00
Brent Shepherd bbcc2441a4 Add new 'woocommerce_pre_payment_complete' action
And an action to fire when order status != pending|on-hold|failed
2013-09-24 19:54:04 -07:00
Mike Jolley 622715ec36 Option for itemized vs grouped taxes. Closes #3453. 2013-09-23 16:10:09 +01:00
Mike Jolley 96a7a4b730 Restructure 'file_paths' to allow for names (Closes #3320) etc. For #2765.
@coenjacobs @justinstern @maxrice These are major changes - CC ing you
guys in to take a quick look through. I know some extensions such as
vouchers will be affected.
2013-09-20 17:01:09 +01:00
Brent Shepherd f9a42a497d Pass instance of WC_Order to its filters
So that extensions hooking to the filters know which order the current
filter is being applied to and can perform customisation on specific
orders (not just all orders).

Conflicts:
	includes/class-wc-order.php
2013-09-02 14:31:11 +02:00
Mike Jolley a66472d148 Order panel improvements + save multiple shipping methods 2013-08-16 16:43:26 +01:00
Mike Jolley 7cd4e46846 Cleaner orders items, and show meta in text until editing.
@coenjacobs this commit has the urldecode fix. Will move it over to
master/.14 later
2013-08-15 16:49:09 +01:00
Mike Jolley f09fafe738 Meta box refactor
Closes #3458.
2013-08-06 11:41:20 +01:00
Mike Jolley 981575491d Review order columns Closes #2798. 2013-07-31 15:12:53 +01:00
Mike Jolley bf5716af3c If admin user is logged in, link them to order notes. Closes #3433. 2013-07-30 12:35:18 +01:00
Mike Jolley ff0fc4fa31 Check function returns a product. #3526 2013-07-24 21:24:58 +01:00
Mike Jolley 725cb7714b More endpoints for myaccount pages, and endpoint options so they can be modified. Closes #3170. 2013-07-23 17:05:01 +01:00
Mike Jolley e296c9d538 woocommerce_new_order_note_data Closes #3379 2013-06-28 10:50:05 +01:00
Mike Jolley 5be00f2d32 Drop ucwords Closes #3369. 2013-06-28 10:30:32 +01:00
Mike Jolley c72ae714f7 Removed nonce helper
@coe
2013-06-11 17:55:55 +01:00
Mike Jolley c75ea04c1c classes -> includes 2013-06-11 14:25:30 +01:00