Commit Graph

35106 Commits

Author SHA1 Message Date
Nestor Soriano 4531af3382 Small fix in WC_Tests_Admin_Post_Types::bulk_and_quick_edit_stock_status_for_variable_product.
At some point the 'change_stock' key is assumed to be present
in the request data, but it might not. Fixed to test for existence
before using the value.
2020-07-14 11:42:21 +02:00
Nestor Soriano e05aa8a03a Add unit test for WC_Admin_Post_Types::bulk_and_quick_edit_save_post.
The test added checks that stock status of variations when saving
a variable product is changed or not appropriately depending on
the request data supplied.
2020-07-14 11:42:21 +02:00
Nestor Soriano a3ee904081 Add login_as_role and login_as_administrator to WC_Unit_Test_Case.
Those methods are a convenient replacement for
"this->factory->user->create". Tests that were using that to
simulate user login have been modified to use the new methods.
2020-07-14 11:42:21 +02:00
Nestor Soriano 9c2a43bfd5 Fix code sniffer errors in a few unit test files. 2020-07-14 11:42:21 +02:00
Nestor Soriano b71a9c33b6 Extract $_REQUEST to a method in WC_Admin_Post_Types.
Create a new `request_data` method in WC_Admin_Post_Types that
just returns $_REQUEST. This is intended to ease unit testing,
as this method can be easily mocked to return test data.
2020-07-14 11:42:21 +02:00
Nestor Soriano fd34cf76b2 Fix stock status setting for variable products on bulk & quick edits.
For bulk edit: even if stock status was left as "No change", the
status of all variations was being changed to whatever the status
of the product was before it was converted to variable. Now
no change is performed when "No change" is selected, and all
variations change to whatever is selected otherwise.

For quick edit: a new "No change" option is added that will be
preselected when the product is variable. Previously, whatever
status the product had before being converted to variable was being
shown, and that's the status that would be set when saving.
Also, a "This will change the stock status of all variations"
message is displayed before the selector.
2020-07-14 11:42:21 +02:00
Nestor Soriano 39e5a1bfb1 Fix code sniffer errors on quick-edit.js 2020-07-14 11:42:21 +02:00
Nestor Soriano ae0d269128 Refactor duplicate code & add rounding to price calculations in WC_Admin_Post_Types.
Two methods have been created:

- update_stock_status, replaces code that was duplicated in the
  quick_edit_save and bulk_edit_save methods.

- set_new_price, replaces code that was duplicated-ish in the
  bulk_edit_save for setting the new regular and sales prices
  (code was not identical but very similar).

Also, `round` is now used on sale price calculations that involve
multiplying by a percent, the same was as it was done already
to calculate the regular price.
2020-07-14 11:42:21 +02:00
Nestor Soriano 7d5b59953c Fix code sniffer errors in WC_Admin_Post_Types. 2020-07-14 11:42:21 +02:00
Peter Fabian 22d3c91182
Merge pull request #26993 from woocommerce/dev/update-versions-after-4.3-release
Update versions and changelog from latest releases.
2020-07-13 21:05:37 +02:00
Peter Fabian 23028a90a1 Schema has not been updated, so revert. 2020-07-13 15:34:54 +02:00
Peter Fabian 6bc0ca724f Update versions and changelog from latest releases. 2020-07-09 13:18:51 +02:00
Peter Fabian 730df27bc6
Merge pull request #26980 from woocommerce/update/woocommerce-admin-1.3.0
Update WooCommerce Admin to 1.3.0
2020-07-08 18:58:00 +02:00
Timmy Crawford 1fb700486b Update WooCommerce Admin to 1.3.0 2020-07-08 09:51:54 -07:00
Claudio Sanches 864f451775
Merge pull request #26338 from woocommerce/fix/25561
Fixed user cap required to view the order count indicator
2020-07-08 12:09:28 -03:00
Claudio Sanches eeb08467af
Merge pull request #26877 from woocommerce/fix/26547
Fixed WooCommerce menu for users that can only manage orders on WooCommerce
2020-07-08 12:08:29 -03:00
Peter Fabian 7830e90550
Merge pull request #26966 from woocommerce/update/woocommerce-admin/1.3.0-rc.3
Update woocommerce-admin to 1.3.0-rc.3
2020-07-07 11:39:32 +02:00
Timmy Crawford bb32e4a557 Update woocommerce-admin to 1.3.0-rc.3 2020-07-06 15:15:15 -07:00
Peter Fabian db7ca984a5
Merge pull request #26955 from woocommerce/fix/bump-template-versions-4.3
Update template versions for 4.3.
2020-07-06 22:10:19 +02:00
Peter Fabian 0b3900b84a
Merge pull request #26963 from woocommerce/arch/remove-type-hints-from-src
Removed type hints from src folder.
2020-07-06 18:54:25 +02:00
Peter Fabian d54a2c3b2f Removed type hints.
Based on the design committee, we've decided not to use 'old' classes from the includes folder in new code in the 'src' directory. Thus removing those type hints, but leaving them in the docblock to not lose the information.
2020-07-06 15:36:33 +02:00
Peter Fabian e20568be7d Update template versions for 4.3. 2020-07-04 21:57:39 +02:00
Claudio Sanches 85580cfb4f
Merge pull request #26935 from woocommerce/fix/26822
[Tracker] Added order_total to orders_edit_status_change
2020-07-02 16:29:13 -03:00
Néstor Soriano 7fa34c6770
Merge pull request #26400 from woocommerce/fix/26242
Make WC_Cart::display_prices_including_tax() aware of tax display changes
2020-07-02 14:56:50 +02:00
Claudio Sanches 0d9b6786fd [Tracker] Added order_total to orders_edit_status_change 2020-07-01 18:24:47 -03:00
Claudio Sanches 0dfd97370e
Merge pull request #26934 from woocommerce/fix/unit-tests
Fixed unit tests for #26462
2020-07-01 18:14:15 -03:00
Claudio Sanches d3d8e74b58 Fixed unit tests for #26462 2020-07-01 18:13:29 -03:00
Claudio Sanches f50574035d Merge branch 'priyankabehera-fix/26780' 2020-07-01 18:02:04 -03:00
Claudio Sanches b772d0eaf3 Merge branch 'fix/26780' of https://github.com/priyankabehera/woocommerce into priyankabehera-fix/26780 2020-07-01 18:01:51 -03:00
Claudio Sanches c6f3c00428
Merge pull request #26933 from woocommerce/fix/error
Fixed missing comma
2020-07-01 17:56:53 -03:00
Claudio Sanches e20a69c35c Fixed missing comma 2020-07-01 17:56:19 -03:00
Claudio Sanches ee2087a7d3
Updated template version 2020-07-01 17:42:33 -03:00
Claudio Sanches bdf996eec8
Fixed use of esc_html() and bumped the template version
Also fixed some coding standards
2020-07-01 17:39:49 -03:00
Claudio Sanches 9149160f6a
Merge pull request #26894 from imwatsi/patch-1
Add Namibia regions
2020-07-01 15:10:50 -03:00
Claudio Sanches b813c620cc
Fixed typo 2020-07-01 15:10:16 -03:00
Claudio Sanches d3f9202c73
Merge pull request #26315 from woocommerce/add/nightly-builds-workflow
Introduces nightly builds workflow
2020-07-01 14:38:01 -03:00
Claudio Sanches a1eb697bd3
Merge pull request #26634 from corsonr/fix-26633
Fix #26633 - Adds Custom Messages Upon WC Taxonomies Update
2020-07-01 14:36:38 -03:00
Claudio Sanches 101a8ae243
Added context 2020-07-01 14:36:22 -03:00
Claudio Sanches c6fbae605b
Merge pull request #26609 from woocommerce/fix/26608-twentytwenty-price-underline
Twenty Twenty: remove underline from discounted prices
2020-07-01 14:28:32 -03:00
Claudio Sanches 525025b866
Merge pull request #26591 from mellooor/master
fix #26209 - email link color clash
2020-07-01 14:27:18 -03:00
Claudio Sanches f6a1708a95
Merge pull request #26613 from woocommerce/remove_html_from_plain_text_email
Remove html tags from plain text email template
2020-07-01 14:23:14 -03:00
Claudio Sanches f17535fabd
Merge pull request #26589 from mariovalney/fix/26588
Fixes issue #26588
2020-07-01 14:18:06 -03:00
Claudio Sanches eb794e74ae
Merge pull request #26927 from woocommerce/update/template-version
Bump template version
2020-07-01 14:16:51 -03:00
Claudio Sanches 5db9afca28 Bump template version 2020-07-01 14:16:10 -03:00
Claudio Sanches 44348502cc
Merge pull request #26545 from damiencarbery/patch-1
Allow heading filter for cross sells component.
2020-07-01 14:14:37 -03:00
Claudio Sanches ef6b369726
Merge pull request #26536 from catchmareck/master
Trigger removed_coupon_in_checkout event after coupon removal on checkout
2020-07-01 14:13:49 -03:00
Claudio Sanches dfe2f05e27
Merge pull request #26516 from woocommerce/fix/twenty-twenty-block-styles
Remove TwentyTwenty Block styles
2020-07-01 13:27:57 -03:00
Claudio Sanches 1de6bf0c28
Merge pull request #26515 from koko-ng/patch-1
Fix error message in wc_get_template
2020-07-01 13:27:05 -03:00
Claudio Sanches 1194225d71
Merge pull request #26503 from Knyazevich/origin/fix/wc_update_product_stock_status-phpdoc
Fix parameter type and add an empty line in wc_update_product_stock_s…
2020-07-01 13:21:21 -03:00
Claudio Sanches b3160ccf52
Merge pull request #26483 from szepeviktor/patch-1
Make caching in CI predictable
2020-07-01 13:20:35 -03:00