Commit Graph

644 Commits

Author SHA1 Message Date
Claudio Sanches ba0773d12e Apply wc_get_product_classname() in the current code base 2019-11-13 15:30:09 -03:00
Timothy Jacobs b9bb4a7c6a
Use a separate first parameter for the WP_Error
This matches the pattern used elsewhere in WooCommerce and allows access to the original `WC_Product` object if an error is to be returned.
2019-10-02 15:01:09 -04:00
Pinal 7418ed123f Hook name changes
Updated the hook name as suggested.
2019-08-29 12:42:33 +05:30
Pinal e47f835f7a Add new hook for add-order-item
Added a new hook for validations in the add_order_item() called in
WC->Orders->Add/Edit Orders.

Allow plugins to perform validations/changes to the order before a
product is added the order.
2019-08-28 17:30:24 +05:30
Diego f95f73c548 Added arguments to filter `woocommerce_ajax_order_item` 2019-07-09 13:31:47 +01:00
Rodrigo Primo a26f38f3a1
Merge pull request #23133 from woocommerce/update/23111
If variations are missing prices, show notice
2019-07-04 10:08:41 -03:00
Gerhard Potgieter c3a25bb6bf
Merge pull request #23884 from woocommerce/fix/23875
Prevents taxes columns from being removed when the order is no longer editable
2019-07-04 09:25:49 +02:00
Yash Kapoor 84fd2bbca9
Update class-wc-ajax.php
Removed unused code.
2019-06-25 10:58:56 +05:30
Gerhard 9212ee5082 Add check before calling wc_delete_order_item for taxes to make sure order is editable. 2019-06-20 15:01:01 +02:00
rmalviya 5bf8adf2dd Send boolean as expected, not string
Originally checkout.js:336 expected string but changed to boolean
with 4ad370985. Send boolean for `reload` in json and fix #23888.
2019-06-08 20:12:44 +05:30
Gerhard Potgieter b2ed079520 Manual orders coupon usage limits by email (#23775)
* Add functionality to wp-admin order to check for coupon usage based on email addresses, similar to how WC_Cart handles this seperately, included unit tests.

* Only do the coupon by email usage check if order is from a guest. Fix issue with unit test.
2019-05-27 11:45:29 -03:00
Timmy Crawford e12e4aaa25
Merge pull request #23304 from woocommerce/fix/link-all-variations
[3.6] Fix logic in link all variations
2019-04-15 11:16:22 -07:00
Mike Jolley d0c6c54989 Moved link/create code to data store with new unit test
This code was not testable within ajax code, so moved to the data stores.
2019-04-15 11:59:57 +01:00
Manos Psychogyiopoulos b1d7b2c6d0 Refactor json_search_downloadable_products_and_variations 2019-04-09 05:41:49 +03:00
Manos Psychogyiopoulos f6c560d684 Introduce IN and NOT IN clauses in `WC_Product_Data_Store_CPT::search_products`
closes #23245
2019-04-09 05:33:50 +03:00
Mike Jolley 9907a25ff6 Append notice if variations are invalid 2019-03-25 13:30:04 +00:00
Mike Jolley 174ca94b79 WC_Ajax::add_variation - force variable product type 2019-03-25 11:56:48 +00:00
Rodrigo Primo 5d14d30b8c Remove outdated comment
Commit
be05eea5da (diff-133db5662c51f5686d87611121a05a3bL88)
changed how ajax events are stored and now an associative array is not used anymore for both private and non private events. Instead two different arrays are now used one for each type of event.
2019-03-13 09:21:29 -03:00
Rodrigo Primo ab89222cfa Fix typo
Typo added in be05eea5da (diff-133db5662c51f5686d87611121a05a3bR45)
2019-03-13 09:10:53 -03:00
Rodrigo Primo a41e29e05f Fix error introduced by commit be05eea5da
Commit be05eea5da (diff-133db5662c51f5686d87611121a05a3bR1420) fixed all the PHPCS violations in includes/class-wc-ajax.php, but it unintentionally changed that the logic of WC_Ajax::json_search_products(). This commit reverts the changes to the old logic while keeping the PHPCS fixes.

Before the modification mentioned above, `$_GET['term']` would be used only if `$term` was empty. After this modification, `$_GET['term']` is used whenever it is set and `$term` (the parameter passed to the method) stopped being used. This commit restores the original logic in that what is passed in the first parameter as `$term` is used by default, and `$_GET['term']` is only used if `$term` is empty.
2019-03-12 20:23:28 -03:00
Mike Jolley 5b1814016b Add stock with different function 2019-03-12 14:48:05 +00:00
Mike Jolley c39f447ff4 Merge branch 'fix/22937' 2019-03-12 13:27:13 +00:00
Mike Jolley 143068332d Pass user ID when adding coupons via admin 2019-03-08 16:14:49 +00:00
Mike Jolley 2bb39a4c79 Update from master 2019-03-06 12:08:07 +00:00
Mike Jolley ea27a3e889 Merge branch 'master' into fix/22937 2019-03-06 11:46:37 +00:00
Mike Jolley 557530e43a Use wc_format_coupon_code when handling posted values 2019-03-06 11:44:54 +00:00
Mike Jolley 46bdad07e9 Array init code was wrong 2019-03-05 14:51:58 +00:00
Mike Jolley f707eeda3e Update from master 2019-03-05 13:31:14 +00:00
Mike Jolley a49d4a04a1 Update throws tags 2019-03-05 13:05:55 +00:00
Mike Jolley 2d5e834cf2 Merge branch 'pr/22822' 2019-02-27 11:56:08 +00:00
Mike Jolley c854e74471 Spacing 2019-02-27 11:56:00 +00:00
Naveen giri 913b8e84bf Fix wpcs error and avoid unnecessary checks 2019-02-26 18:31:34 +05:30
Mike Jolley e21912294a calc shipping before totals 2019-02-22 16:43:42 +00:00
Naveen giri f741d507ba Bugfix/#22821: Add Fix for Warning and Notices on save attribute button click 2019-02-22 19:27:16 +05:30
Mike Jolley e830bd739a Use taxable address when adding/removing coupons 2019-02-21 16:23:20 +00:00
Mike Jolley 5bb5ae6265 Update from master 2019-02-18 16:54:24 +00:00
Mike Jolley 3abe162bd6 Error handling in wc_ajax_headers 2019-02-15 17:23:34 +00:00
Mike Jolley be05eea5da phpcs all the things 2019-02-15 17:09:45 +00:00
Mike Jolley 893b33973c Merge branch 'fix/22147' 2019-02-04 13:05:40 +00:00
Mike Jolley 40694118fc Merge branch 'pr/21050' 2019-01-31 15:47:52 +00:00
Gerhard 25e562400e Put reload checkout in variable before unsetting it and then calling it again after it was unset. 2019-01-29 13:05:02 +02:00
Ron Rennick 6709049cbc round variation percentage price adjustments to decimal setting 2019-01-23 14:04:04 -04:00
Mike Jolley 6367d19615 phpcs 2019-01-21 08:11:40 -08:00
Ron Rennick 6b1341138f phpcs sniff fixes for class-wc-ajax.php 2019-01-11 12:57:33 -04:00
Ron Rennick 641884b71b return coupon error messages as text message for alert() 2019-01-11 12:50:44 -04:00
Mike Jolley fe02144d0a
Merge pull request #21927 from woocommerce/add/21925
Make links in order notes clickable.
2019-01-09 16:52:37 +00:00
Mike Jolley 868e7841e6
Merge pull request #21860 from rellect/wc_case
Rename wc() to WC() for consistency
2019-01-08 14:29:59 +00:00
Mike Jolley a0aa663f29 Attribute post data needs stripslashes 2019-01-08 13:25:27 +00:00
Claudiu Lodromanean 3b14bfb90b
Merge pull request #22270 from Prospress/fix/22149
strip slashes from tax classes on save
2019-01-07 11:39:35 -08:00
Mike Jolley 217c039262 Merge branch 'pr/21465' 2019-01-07 13:29:40 +00:00
Mike Jolley f4dbd5a723 Define consistently 2019-01-07 13:29:09 +00:00
Mike Jolley 05de936932
Merge pull request #21581 from codemascot/161018-131105-class-wc-ajax.php
Removed unnecessary variable.
2019-01-07 12:43:40 +00:00
JeroenSormani f4775ccd90 Use shipping method instead of property through magic + doc return statements 2019-01-04 12:41:38 +00:00
Mike Jolley cbee6af449 Use helper and return notes. 2019-01-03 13:40:48 +00:00
Mike Jolley 5ef45f51f6 Stock handling in ajax class only 2019-01-03 12:23:49 +00:00
Mike Jolley 184b121eb8 Use adjust stock handling 2019-01-02 17:09:45 +00:00
Ron Rennick 292c5c5dcc strip slashes from tax classes on save 2018-12-19 15:22:04 -04:00
Gerhard fae1e1cce1 Make links in order notes clickable. 2018-11-15 14:27:26 +02:00
Refael Iliaguyev 127f1cb276 Use WC() instead wc() for consistency 2018-11-08 12:59:07 +02:00
Claudiu Lodromanean b551f57173
Merge pull request #21769 from nishitlangaliya/issue-21765
fix: Manually adding fee on order generate html code
2018-11-05 15:27:33 -05:00
nishitlangaliya b7cf72d626 fix: save fee name without html from base source 2018-11-03 00:19:30 +05:30
Claudio Sanches a1875a135e Added exception for when a non-admin user tries assign API keys to an admin 2018-11-02 10:21:18 -07:00
Khan M Rashedun-Naby 439bd54ce5 The variable should be 0 rather than empty string 2018-10-16 14:23:43 +06:00
Khan M Rashedun-Naby 7940694ce4 Removed Unnecessary Variable. 2018-10-16 13:25:56 +06:00
Frédéric Demarle 7c3ef6cc27 Fix missing punctuation mark a the end of the comments 2018-10-04 20:22:18 +02:00
Frédéric Demarle e20ce00101 Fix ajax responses not testable when calling wp_send_json_success in a try block 2018-09-28 13:42:51 +02:00
claudiulodro 178f98ff65 Fix attribute saving 2018-09-19 11:35:46 -07:00
Peter Fabian 964ee9ac1a Unslash city name to prevent double escape. 2018-08-27 18:33:14 +02:00
Peter Fabian 2e350fe5b7 Small PHPCS fix. 2018-08-24 09:21:49 +02:00
Peter Fabian f5fd36fbdf Updated order of array traversal to respect user's order when changing order of attributes for variations. 2018-08-23 18:41:28 +02:00
Florian Ludwig 0f6f6814ad Moves cart hash calculation to WC_Cart class 2018-08-14 18:08:55 +02:00
Claudiu Lodromanean 2a3cedddcd
Merge pull request #20520 from woocommerce/feature/product-custom-tables-supporting-changes
Product custom tables supporting changes
2018-06-27 08:57:50 -07:00
Mike Jolley f9530c3ba2 Remove order again from URls 2018-06-22 13:32:21 +01:00
Rodrigo Primo b6e73f528b Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-06-15 14:56:31 -03:00
Claudiu Lodromanean fc02687545
Merge pull request #20470 from woocommerce/update/20454
Support limiting search results
2018-06-15 09:03:07 -07:00
Mike Jolley 5e6405b650 Merge branch 'master' into update/13359 2018-06-15 15:12:12 +01:00
Mike Jolley 04e304921a Show stock based on querystring var 2018-06-15 15:11:07 +01:00
Mike Jolley 01a3e359c3 Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-06-13 10:18:38 +01:00
therealgilles 3818598811 Rename woocommerce_checkout_skip_update_order_review_expired to woocommerce_checkout_update_order_review_expired and change filter polarity. 2018-06-11 20:29:16 +00:00
therealgilles 1d733236e0 Merge branch 'master' of https://github.com/woocommerce/woocommerce 2018-06-10 18:53:13 +00:00
Mike Jolley 81149157a3 woocommerce_json_search_limit filter 2018-06-09 17:22:26 +01:00
Mike Jolley 52854b7690 Add qty to order via modal, include stock qty in formatted name display for reference 2018-06-08 16:18:32 +01:00
Mike Jolley 8261cffaa7 Remove bulk actions 2018-06-07 18:01:21 +01:00
Mike Jolley 4df54b4e53 Merge branch 'master' 2018-06-07 11:24:12 +01:00
therealgilles 830e42794e Add woocommerce_checkout_skip_update_order_review_expired and woocommerce_checkout_skip_cart_is_empty_check filter calls. 2018-05-23 20:40:23 +00:00
therealgilles f7ec8c22de Add woocommerce_checkout_skip_update_order_review_expired and woocommerce_checkout_skip_cart_is_empty_check filter calls. 2018-05-23 20:08:14 +00:00
Claudio Sanches 09f7425fea Just use exit() in AJAX endpoints used to redirect users 2018-05-23 10:50:49 -03:00
Mike Jolley be63fb152a Preview checkout without dummy product 2018-05-22 11:19:09 +01:00
Mike Jolley 1ff5520512 Pass through JSON context when getting zones for JSON responses and scripts 2018-05-09 17:41:33 +01:00
Claudiu Lodromanean 305167efba
Merge pull request #19933 from franticpsyx/deprecate-woocommerce_ajax_added_order_items
[3.4] Deprecate woocommerce_ajax_added_order_items action
2018-05-03 08:03:55 -07:00
Mike Jolley 06ef8c8589 Hook doc update 2018-05-02 14:28:53 +01:00
Manos Psychogyiopoulos 1895bbe3f3 Deprecate woocommerce_ajax_added_order_items action 2018-05-02 14:49:24 +03:00
Rodrigo Primo 597033ca6f Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-04-24 13:47:22 -03:00
Mike Jolley bd539e38f0 Remove output buffering 2018-04-19 18:27:29 +01:00
Khan M Rashedun-Naby 74c2ceb3d1 Removed unnecessary variable. 2018-04-17 00:09:30 +06:00
Mike Jolley 1b34cd4745 Moved settings tabs around to allow for privacy page. 2018-04-12 16:59:42 +01:00
Mike Jolley 47fbd79d8f Clear shipping transient when saving shipping method on zones screen 2018-04-10 12:25:09 +01:00
Rodrigo Primo bb553c88ae Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-03-29 12:05:55 -03:00
Mike Jolley 04eadf13ac Merge branch 'master' into update/18894 2018-03-08 13:08:40 +00:00
Rodrigo Primo 3a480e5d80 Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-03-01 08:02:08 -03:00