Commit Graph

5565 Commits

Author SHA1 Message Date
vedanshujain 892b7caa37 Stock managment fixes:
1. Use $already_reduced_stock instead of also considering $refunded_item_quantity while deleting orders. This will bring back part of #27504 again, but for now this seems to be the best solution for countering #28605. It needs discussion whether deleting a line item completely should also undo any refund related changes on it or not.

2. Also mark `stock_reduced` flag on order if any of the line item has any `_reduced_stock` flag. This will allow for stock restoring logic to work properly when order is cancelled.

3. Only adjust line item stock when order is in `processing`, `completed` or `on-hold` status state, because we need to reduce stocks on these status only. Stock adjustments in refunds or when changing statuses is already taken care of by their specific hooks.
2020-12-17 22:28:21 +05:30
Vedanshu Jain 4339aee35f
Merge pull request #27352 from juliquiron/fix/slow-wc-customer-get-operations
Added cache and filter for wc-customer get operations.
2020-12-14 09:43:04 +05:30
Roy Ho aa89afcf95
Merge pull request #28332 from woocommerce/update/replace-jquery-click
Replace usages of depracted jQuery.fn.click() event shorthand
2020-12-07 06:03:56 -08:00
Rodrigo Primo 23af5478ec Fix JS coding standards 2020-12-05 11:11:56 -03:00
Roy Ho f698fbdeee
Merge pull request #28403 from bordoni/issue/28291
Prevent non-numeric values from throwing a Warning on PHP 7.4+
2020-12-01 10:43:13 -08:00
Gustavo Bordoni d6d68ed9cd
Remove white space. 2020-12-01 13:16:53 -05:00
Roy Ho 89efae43a1
Merge pull request #28416 from woocommerce/fix/issue-27154
Fix/issue 27154
2020-11-30 06:14:15 -08:00
OlegApanovich 26dae12279 Fix toggle chevron issue in admin edit product data attribute section #27923
After chevron clicking on attribute section complete edit product data section toggled insted cliackig area.
Key point issue is missing 'postbox' class of wordpress postbox.js library for a attribute block that we try to toggle.
2020-11-27 11:50:44 +02:00
roykho 3981377809
Strip the tags from product description on all other select2 fields that performs searches 2020-11-25 13:32:50 -08:00
Gustavo Bordoni 2909be0777
Prevent non-numeric values from throwing a Warning on PHP 7.4+
Resolves #28291
2020-11-25 00:10:04 -05:00
Rodrigo Primo 1fca8bb1b1 Replaces a few more instances of jQuery.fn.click() event shorthand
This commit replaces a few more instances of jQuery.fn.click() event shorthand that were missed in the previous commit. For more information see the commit message for 8ebead165e.
2020-11-18 16:31:17 -03:00
Rodrigo Primo ee31c791af Fix PHPCS violations 2020-11-18 15:33:36 -03:00
Rodrigo Primo 8ebead165e Replace usages of depracted jQuery.fn.click() event shorthand
This commit replaces all instances in WooCommerce codebase (except included third-party libraries) where jQuery.fn.click( handler ) event shorthand was used. This shorthand was deprecated in jQuery 3.3 (see https://github.com/jquery/jquery/issues/3214). The jQuery documentation was not updated yet (see https://github.com/jquery/jquery-migrate/issues/288 and https://github.com/jquery/api.jquery.com/issues/972).

jQuery.click() was not deprecated and so it was not replaced.
2020-11-18 15:27:46 -03:00
Renatho De Carli Rosa c2b066edcb Fix requires_php check 2020-11-13 16:47:26 -03:00
Renatho De Carli Rosa 5cbcdcd92c Add requires_php support
With this check, we're able to avoid updates when the PHP version
is not supported
2020-11-13 16:47:26 -03:00
Christopher Allford 03f65478f2
Merge pull request #28249 from woocommerce/add/composer-2
Update Composer to v2 (includes woocommerce-blocks 3.8.0 and woocommerce-admin 1.7.0)
2020-11-12 21:16:51 -08:00
Christopher Allford 2516414eb6
Merge pull request #28229 from woocommerce/add/wc-pay-extensions-screen
Add WooCommerce Payments banner to extensions screen
2020-11-12 14:21:01 -08:00
Christopher Allford 30d2e278b9 Replaced the deprecated `WC_Admin_Note` class 2020-11-12 13:26:30 -08:00
roykho 5597f74e81
Merge branch 'master' into fix/issue-27972 2020-11-12 06:21:52 -08:00
roykho 134786ada8 Fix stock reducing incorrect amount when order item is deleted after a refund closes #27504 2020-11-11 15:28:06 -06:00
Gerhard Potgieter 6832dc96a4 Make wc shipping button also purple 2020-11-10 19:43:11 +02:00
Gerhard Potgieter 3c1352d36c Remember to break 2020-11-10 19:36:34 +02:00
Gerhard Potgieter caf2ea99fa Shorten title as per feedback 2020-11-10 19:26:44 +02:00
Gerhard Potgieter a0812d5009 Remove redirect as it does not work with the background installer 2020-11-10 18:28:47 +02:00
Gerhard Potgieter b5fb7c0104 Add purple woo button 2020-11-10 18:26:59 +02:00
Gerhard Potgieter b5a4a1597f Fix current section check, phpcs linting errors. 2020-11-10 16:48:11 +02:00
Gerhard Potgieter 692dfa7fec Update banner copy 2020-11-09 15:21:38 +02:00
Gerhard Potgieter 8af8554770 Add functionality to handle woocommerce payments install 2020-11-09 14:48:49 +02:00
Gerhard Potgieter 7d33488d6b WooCommerce Services to WooCommerce Shipping 2020-11-09 14:22:20 +02:00
Gerhard Potgieter 78336781d1 Remember output_ in function name 2020-11-09 14:20:24 +02:00
Gerhard Potgieter b1d9363918 Add wc payments to extensions addons page. 2020-11-09 14:19:11 +02:00
roykho 4c079ea99e
Update SSR version to check against major versions only closes #27972 2020-10-27 08:16:35 -07:00
Roy Ho c96a642e8a
Merge pull request #28067 from woocommerce/fix/27529
Fix: use the correct parameter when calling get_avatar()
2020-10-26 07:46:51 -07:00
Rodrigo Primo 09faf8ba84 Fix: use the correct parameter when calling get_avatar()
`WC_Admin_Dashboard::recent_reviews()` was calling `get_avatar()` passing `$comment->comment_author` which is not one of the list of parameters that the function accepts to get the avatar. As a result, the widget that displays the recent reviews in the admin dashboard was never displaying the avatar of the user that left the review. This commit fixes this issue by passing `$comment->comment_email` instead. I opted to use `$comment->comment_author` as it should be available for reviews left both by authenticated and anonymous users and because getting the comment object wouldn't be so simple (either we need to perform an extra query for each review or deprecate the `woocommerce_report_recent_reviews_query_from` filter).
2020-10-22 17:43:59 -03:00
Rodrigo Primo e91872c1a8 PHPCS fixes 2020-10-22 17:34:47 -03:00
pjv f03bfb85da Fix incorrect capability for product sorting link
Fixes #28049
2020-10-22 13:03:35 -05:00
Rodrigo Primo 0a81188e42
Merge pull request #27987 from woocommerce/php8/fix-required-parameters-after-optional-take-2
[PHP 8] Convert optional-before-required parameters into required parameters (take 2)
2020-10-17 09:42:20 -03:00
roykho e8bcd464db
Update escape based on suggestion 2020-10-16 06:00:34 -07:00
Nestor Soriano 63ced34e2d Convert optional-before-required arguments to required (take 2)
In PHP 8 required parameters after optional parameters in
function/method signatures trigger a deprecation notice. These type
of parameters are pointless since a value needs to always be
provided for them anyway, so they are actually de-facto required.

This commit converts all these not-so-optional parameters into
truly required parameters by removing their default values.
2020-10-16 13:08:31 +02:00
roykho 800cbdbc7e
Add missing escapes 2020-10-15 16:31:56 -07:00
roykho ace411aacd
Fix billing email being parsed as a URL link when beginning of email contains www closes #25099 2020-10-15 14:25:03 -07:00
Néstor Soriano e4a109f0d1
Merge pull request #27763 from woocommerce/fix/27445
Remove protection as we already diff and update only if needed.
2020-10-15 10:01:34 +02:00
Claudio Sanches e34681dbb4
Merge pull request #27696 from woocommerce/fix/version-race-conditions
Fix some race conditions in WC_Install
2020-10-14 20:18:47 -03:00
Claudio Sanches 23fe4f71bb
Merge pull request #27842 from sudoshreyansh/fix/27839
Fixed </strong> closing tag position. Issue: #27839
2020-10-14 18:06:10 -03:00
Néstor Soriano c15488d840
Merge pull request #27830 from woocommerce/php8/fix-round-function-with-non-numeric-argument 2020-10-09 08:01:44 +02:00
Knyazevich ce59afb2b9 Simplify drafts excluding logic (ref #24136) 2020-10-06 18:11:58 +03:00
Knyazevich f551c6c792 Exclude drafts from the "Shop page" select (ref #24136) 2020-10-06 06:42:56 +03:00
sudoshreyansh dd9bf06594 Fixed </strong> closing tag position. Issue: #27839 2020-10-02 15:46:41 +05:30
Nestor Soriano 52eed70f04 Add a 'NumberUtil' class with a 'round' method.
There's a number of places in the WooCommerce codebase where the
built-in function 'round' is executed passing a non-numeric value
(not a number and not a string that can be parsed as a number),
for example round(''). In PHP 7 this yields a value of 0, but in
PHP 8 this throws an error.

This commit adds a 'NumberUtil' class with a static 'round' method,
this method checks if the passed value is numeric and if so it just
executes the built-in function, otherwise it returns 0. And all the
calls to 'round' in the codebase are replaced with 'NumberUtil::round'.
2020-10-01 11:08:51 +02:00
vedanshujain c69e1f5799 Remove protection as we already diff and update only if needed.
In #26642 we removed adding reduced_stock meta when adding new order item to prevent ghost entries, but in inadvertently exposed an underlying bug where _reduced_stock meta was getting set to 0 if its emtpy.

We were then checking the presence of this meta, but also not reducing the stock in case it was not set.
2020-09-24 00:54:24 +05:30