Commit Graph

243 Commits

Author SHA1 Message Date
claudiulodro b27fb203ef Add wiki link to wc_get_orders 2017-06-01 11:58:43 -07:00
Mike Jolley 71a4b4b75d Code standards 2017-06-01 12:08:48 +01:00
Pablo dos Santos Gonçalves Pacheco 435c29771e Create function to sanitize order id
I've realized that tracking an order id with **[woocommerce_order_tracking]** using # will not work. Some users think that they need to use the hash because it's the WooCommerce default. The new **wc_sanitize_order_id()** function fixes that.

And **woocommerce_shortcode_order_tracking_order_id** filters the order_id that comes from query string and is used on **[woocommerce_order_tracking]**.

It can be used for other cases though.
I hope it helps :)
2017-05-31 17:34:00 -03:00
Diego Zanella b14a2db2e6 Fix for #15336
* Replaced reference to `WC()->payment_gateways` property with call to `WC()->payment_gateways()` method.
2017-05-29 13:02:16 +01:00
Mike Jolley f6df18542a Merge pull request #15113 from bekarice/fix/wc_create_refund-date
Fix: Re-add date for wc_create_refund()
2017-05-23 19:33:23 +01:00
Beka Rice 8885d58799 Fix: Re-add date for wc_create_refund 2017-05-17 04:46:56 -04:00
Rasmus Bengtsson 185934fad9 Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
claudiulodro cec2c3b7dc Couple requested changes 2017-05-13 12:22:22 -07:00
claudiulodro d9c5536cf2 formatting 2017-05-12 15:31:34 -07:00
claudiulodro fe40e9b96a Make date queries work properly 2017-05-12 15:25:15 -07:00
claudiulodro 2ce90b3eb6 Slightly better date handling 2017-05-12 12:59:54 -07:00
claudiulodro 3861e32803 Migrate wc_get_orders 2017-05-12 11:45:01 -07:00
Mike Jolley 7c82087bcd Check we have a valid order in wc_get_payment_gateway_by_order
Fixes #14973
2017-05-10 19:54:20 +01:00
Mike Jolley 505813403e @used-by WC_Order::set_status comment
#13891
2017-04-04 11:52:54 +01: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 b3198d2546 woocommerce_after_register_post_type action 2017-03-28 12:37:17 +01:00
Mike Jolley f50254be28 Update notice to protect against calls before post type registration
Closes #13763
2017-03-28 12:03:09 +01:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03: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
Claudio Sanches c4134586cd FUpdate how save download dates 2017-03-13 20:54:33 -03:00
Mike Jolley 8ab839a030 Replace template usage of dates 2017-03-10 16:35:47 +00:00
Claudiu Lodromanean e36ee46dea Make increase_usage_count work correctly on concurrent checkoutt 2017-03-08 15:27:37 -08:00
Mike Jolley fce44e2271 Status filter adjustment #13357 2017-02-27 11:55:09 +00:00
Mike Jolley 31d428131e Imrpove checkout performance when updating product sales 2017-02-10 23:41:53 +00:00
Mike Jolley b5572fc041 wc_create_refund should handle payment and stock 2017-02-08 16:19:47 +00:00
Justin Shreve b660eda4b8 Add date searching to wc_get_orders. 2017-01-17 12:52:27 -08:00
Mike Jolley 451199a388 Hooks when creating refunds 2017-01-10 14:14:05 +00:00
Mike Jolley d7dfdd3d10 Wrap all deprecation calls. 2016-11-23 16:15:00 +00:00
Mike Jolley b1007c9d62 Fix order item meta saving 2016-11-23 15:37:34 +00:00
Mike Jolley edf973d35f Feedback 2016-11-21 14:30:56 +00:00
Mike Jolley b1565cf0d6 Download update routine and interface 2016-11-18 19:29:37 +00:00
Mike Jolley 1b6d7acd24 Data store for downloads 2016-11-18 17:13:02 +00:00
Mike Jolley ac3be6ba50 Order stores complete 2016-11-18 14:07:21 +00:00
Mike Jolley 5d9a9b4dec Fix tests 2016-11-18 11:14:09 +00:00
Mike Jolley c933f82961 Refunds 2016-11-17 16:53:13 +00:00
Mike Jolley ac6bda2f62 Product crud abstract todos (#12316)
* Get dimensions and weights, with soft deprecation

* Product attributes

* Ratings

* Fix read method

* Downloads

* Feedback

* Fix up store
2016-11-11 15:31:00 +00:00
Mike Jolley 4fc03c9930 Revert "[Product CRUD] Abstract todos (#12305)"
This reverts commit 9a6136fcf8.
2016-11-11 11:58:57 +00:00
Mike Jolley 9a6136fcf8 [Product CRUD] Abstract todos (#12305)
* Get dimensions and weights, with soft deprecation

* Product attributes

* Ratings

* Fix read method

* Downloads

* Feedback
2016-11-11 11:43:52 +00:00
Mike Jolley 5f4dbdb733 [Product CRUD] Variations - setters, getters and admin. (#12228)
* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* Feedback fixes
2016-11-09 16:05:49 +00:00
Claudio Sanches 2de494e105 Merge pull request #12219 from ramiy/i18n-translation-comments
i18n: add translators comments
2016-11-03 13:24:35 -02:00
Mike Jolley 32e814eef1 Use all paid statuses in $customer->get_total_spent() 2016-11-03 11:27:03 +00:00
Rami Yushuvaev 55f08d62ae add translators comments 2016-10-29 23:03:28 +03:00
Mike Jolley 85f22f9f11 Update coupon on pending order
Closes #12096
2016-10-18 12:27:56 +01:00
Claudio Sanches 657c312cae Fix strings case (#12069)
* Fixed case for all _e, esc_attr_e and esc_html_e strings

* Fixed case for all _n_noop strings

* Fixed case for all _x strings

* Fixed case for all __, esc_html__ and esc_attr__ strings

* Fixed a few more strings

* Fixed strings in unit tests

* Fix PayPal Standard case.

* Save Order text
2016-10-12 11:16:30 +01:00
Claudio Sanches 7172429244 Fixed coding standards 2016-09-14 16:00:14 -03:00
Claudio Sanches 0fced8d5d5 Fixed wrong "quantity" while reducing stock
cc @mikejolley
2016-09-14 15:35:17 -03:00
Mike Jolley 311c540662 Merge pull request #11833 from aristath/master
Coding Standards (2nd pass)
2016-09-07 10:14:17 +01:00
Mike Jolley 3f9ab31461 Fix CRUD refunds 2016-09-07 10:04:56 +01:00
Aristeides Stathopoulos fde1037757 fix failing tests. 2016-09-01 23:50:14 +03:00
Aristeides Stathopoulos 82f3cc221e WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeOpenParenthesis 2016-08-27 07:23:02 +03:00
Aristeides Stathopoulos 6c30f84fa2 WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys 2016-08-27 06:23:21 +03:00
Aristeides Stathopoulos 17961f6484 WordPress.Arrays.ArrayDeclaration.ValueNoNewline 2016-08-27 06:04:10 +03:00
Aristeides Stathopoulos ec8a0b288b PHPCS: WordPress.Arrays.ArrayDeclaration.NoCommaAfterLast 2016-08-27 05:08:49 +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 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 95b11606fc get_product_from_item -> get_product 2016-08-22 16:51:24 +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 f4a4f6c361 Reduce stock and other notices 2016-08-09 14:15:04 +01:00
Mike Jolley 7685587b22 payment_method 2016-08-05 16:04:41 +01:00
Mike Jolley 84c52370fa more getters 2016-08-05 15:57:40 +01:00
Mike Jolley 39b4831e95 get_id 2016-08-05 15:56:23 +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
Rodrigo Primo 3c485fc2a1 Use WC_Cache_Helper::get_cache_prefix() to generate the cache key for wc_orders_count() 2016-06-29 16:19:47 -03:00
Rodrigo Primo 1a394fbe02 Improve wc_orders_count() performance by running a query to count only posts of the given status
The function wc_orders_count() is called on every admin page. WooCommerce core uses it to count only orders with the status 'processing' and typically a site has only a few of those orders. But since wc_orders_count() calls internally wp_post_count() this means that MySQL will have to count the number of orders of all status. Thus, in a site with a significant number of orders, this query can be slow.

This commit changes wc_orders_count() function to query directly the database to get the number of orders for a given status instead of using wp_post_count(). On a WooCommerce installation I manage, the old query takes about 2 seconds to run and the new query takes 0.002 seconds.
2016-06-29 15:04:59 -03:00
Mike Jolley b11794ceac @Since changes 2016-06-29 12:58:38 +01:00
Mike Jolley eb2a840db0 Use string in search
Closes #11222
2016-06-23 12:32:20 +01:00
Mike Jolley 46439ddba5 Refund unit tests 2016-06-22 16:31:05 +01:00
Mike Jolley 7b3a9b27ed Function replacements for class methods 2016-06-21 20:26:35 +01:00
Claudio Sanches c9a3ce465f Fixe the return type of wc_order_search() 2016-06-13 15:26:14 -03:00
Claudio Sanches e253382702 Created wc_order_search() function
cc @mikejolley
2016-06-13 17:08:20 +01:00
Mike Jolley 3fd15ad50f Unused vars and code docs 2016-06-06 18:57:24 +01:00
Mike Jolley 2cc0ac294e Fix return on add_metadata
Fixes #10892
2016-05-11 15:28:40 +01:00
Mike Jolley 3db3f3796e Clear item meta cache when adding new meta 2016-05-09 10:01:15 +01:00
Mike Jolley 6a4a6d8471 Fix refund shipping 2016-04-29 11:44:28 +01:00
Mike Jolley a588757d33 Feedback 2016-03-14 16:08:42 +00:00
Mike Jolley c1e8dd1fe8 Use wc_get_orders iternally 2016-03-09 16:11:05 +00:00
Mike Jolley d3f98dce03 More advanced customer filter
#10500
2016-03-09 14:50:34 +00:00
Mike Jolley 5075d4bab3 Implement wc_get_orders() function
#10500
2016-03-09 13:25:42 +00:00
Mike Jolley 6880a71ea9 Merge pull request #10141 from woothemes/fix-10135
Fix 10135
2016-02-12 13:37:53 +00:00
Mike Jolley 0c30999a67 When orders update, invalidate money spent user meta.
Closes #9562
2016-02-08 12:26:46 +00:00
Mike Jolley 77e1aa8263 Make qty for refunds negative
Fixes order counts reported in #10135

May however require an upgrade routine and needs more testing. Not for
2.5.

Fixes #10135
2016-01-22 16:28:29 +00:00
Mike Jolley 9890c18b5d Notice if called early.
Closes #9923
2016-01-04 10:43:51 +00:00
Mike Jolley 851fc2a442 Use get_cache_prefix in orders class 2015-11-13 23:11:05 +00: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
Mike Jolley 4e5baf23aa Cache get_item_meta_array for better performance
Closes #8810 @claudiosmweb
2015-11-05 15:21:28 +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
Mike Jolley 630c14124c Avoid firing woocommerce_order_fully_refunded twice 2015-08-13 16:35:52 +01:00
Mike Jolley f8b539eb5e Improved refund email events and woocommerce_order_fully_refunded hook.
Closes #8793
2015-08-12 19:01:05 +01:00
Mike Jolley 7a58c5417c Only process downloads if valid order is found
Closes #8798
2015-08-12 17:21:07 +01:00
Claudio Sanches 0361a10e26 Removed instances of WC_Order in favor to wc_get_order(), closes #8689 2015-07-30 15:07:34 -03:00
Mike Jolley 7b2aec4791 Take item qty into consideration when refunding orders
Fixes #8675
2015-07-29 13:13:41 +01:00
Claudio Sanches 9e41552342 Removed all "@return void" 2015-07-16 16:55:48 -03:00
adnanoner d07e567050 add $args to woocommerce_refund_created action hook
#8432
2015-06-22 17:54:45 +02:00
davidlenehan 718d550252 Merging refund email template files
Changing previous commit to merge templates for partial and full
refunds to cut down on files.
2015-06-18 11:34:21 +01:00
davidlenehan 8b02b02145 Add email notification for partial refunds
fixes #8278

Emails are now sent to the customer when a partial refund is issued. I
referenced #7785 when doing this.

When a full refund happens the email the customer receives is clear
enough that they are getting a full refund. However I thought it would
be useful to add a new line in these new partial refund emails that
states exactly the value of the partial refund as it may not be that
clear.
2015-06-17 15:35:54 +01:00
Justin Shreve b68244f3eb Prevent negative refunds in wc_create_refund by 0ing it out. 2015-06-15 20:20:31 +00:00