Commit Graph

5441 Commits

Author SHA1 Message Date
Nestor Soriano fc0be07e0f Add unit test for WC_Admin_Post_Types::bulk_and_quick_edit_save_post.
The test added checks that the new regular or sale price is
appropriately set when bulk saving.
2020-07-14 11:42:21 +02:00
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 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 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
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
Claudio Sanches dec50429b4
Merge pull request #25240 from shamalisulakhe/issue-24266-solution
Issue 24266 solution - with rerf of
2020-07-01 13:00:58 -03:00
Claudio Sanches cadbc759fe
Merge pull request #26680 from MihaiCraciun/master
Added missing closing select tag to the product exporter category select
2020-07-01 12:57:33 -03:00
Claudio Sanches 2874915339
Merge pull request #26553 from szepeviktor/patch-2
Fix PHPDoc in WC_Notes_Run_Db_Update
2020-07-01 12:46:48 -03:00
Claudio Sanches 4450d2239f
Merge pull request #26660 from woocommerce/add/status-tools-prompt
Adds a prompt to confirm if should run tools in the Status page.
2020-07-01 12:39:54 -03:00
Claudio Sanches f5b9af8591 Keep WooCommerce menu structure if user can edit others shop orders 2020-06-25 20:01:12 -03:00
Claudio Sanches f4d11c89f3
Merge branch 'master' into issue-24266-solution 2020-06-23 16:47:30 -03:00
Ron Rennick e56ef185b0
Merge pull request #26809 from woocommerce/fix/25606
remove privacy page dropdown
2020-06-23 13:34:33 -03:00
Claudio Sanches 3bb7f30c01
Merge branch 'master' into fix/25561 2020-06-23 11:23:29 -03:00
Ron Rennick a88a708286 remove privacy page dropdown 2020-06-18 10:40:17 -03:00
Peter Fabian 14a26aca2c Update min files and selectWoo 2020-06-16 17:15:12 +02:00
Peter Fabian 418d95298a Merge branch 'master' into update/wc-admin-1.3.0-beta-1
# Conflicts:
#	composer.lock
2020-06-16 14:58:43 +02:00
Peter Fabian 35ee21f837
Merge pull request #26754 from woocommerce/fix/25544
Encode HTML entities in product attributes
2020-06-16 14:29:19 +02:00
Peter Fabian bb2cf2e8dc Removed deprecated method call. 2020-06-16 13:18:05 +02:00
Peter Fabian c35c4f1f08
Merge pull request #26395 from woocommerce/revert-26226-revert-25708-update/reserve-stock-for-checkout
Introduce a `reserved stock` class and database table to prevent race conditions during checkout
2020-06-16 11:38:10 +02:00
Peter Fabian 32037e37dd
Merge pull request #26625 from woocommerce/add/homescreen-option
Homescreen: Enable for new stores and add Features Setting section
2020-06-15 21:54:06 +02:00
Peter Fabian 0c96b1452d
Merge pull request #26685 from woocommerce/fix/26248
Removed the notice for untested minor version updates
2020-06-15 21:40:22 +02:00
vedanshujain 34e5d3daa3 Use single sentence for easier translations. 2020-06-15 19:09:52 +05:30
Paul Sealock c7ad889f93 Homescreen: add option and setting 2020-06-15 13:38:02 +12:00
Jonathan Sadowski 4d6aad4ecb Encode HTML entities in product attributes 2020-06-11 14:10:05 -05:00
vedanshujain e00f79417f Alert in status report if base table is not present.
Also add a tool to rerun the check. This needs newer API version to work.
2020-06-05 18:26:49 +05:30
Vedanshu Jain 6564847802
Merge pull request #26454 from woocommerce/enhancement/verify-db
Add `verify_base_db` method to check if all base tables are present.
2020-06-05 15:15:39 +05:30
vedanshujain 4fce106f14 Use `_` instead of `-` as per convention. 2020-06-04 20:33:38 +05:30
Christopher Allford ffe2257f2d Removed the notice for untested minor version updates
With the increased cadence of releases it becomes necessary that we address the `WC tested up to` header's usefulness. It isn't practical to require everyone to update their extensions every month, especially given that we are only doing backwards compatible minor releases. The only case I can think of where we might want to check the minor version is if the Stable tag on Core is downgraded, but due to the naming of the header, this doesn't make any sense.

I considered making this a wildcard of some kind but I think most would bind to a full major version anyway and so this isn't worth the time to add it. As an aside, the tests in `plugin-updates.php` seem to indicate that a header of `WC tested up to: 4` would apply to the entire major version cycle, so wildcards already exist!
2020-06-03 14:36:06 -07:00
Claudio Sanches bf042a428d
Merge pull request #25321 from grey-rsi/status_widget_stock_rows
Add filters for status_widget_stock_rows queries
2020-06-03 11:22:20 -03:00
MihaiCraciun 1df2ba2c7a Added missing closing select tag 2020-06-03 13:40:05 +03:00
Julia Amosova 479cac4fc0 Add note to Products Importer that TXT files are also supported. 2020-06-02 12:55:06 -04:00
Claudio Sanches 5bf9a83e58
Fixed docblock 2020-06-02 12:17:59 -03:00
Claudio Sanches 2267dcfe7e
Updated since tags 2020-06-02 12:16:54 -03:00
Julia Amosova f929bacfc6 Correct grammar mistake in the help tip of the `Connected to WooCommerce.com` field of SSR. 2020-06-02 11:12:47 -04:00
Sergey Ratushnuy ec91a7c3fc Small fix 2020-06-02 15:05:44 +03:00
Claudio Sanches 6afbed0c14 Fixed coding standards 2020-06-01 23:55:17 -03:00
Claudio Sanches 608cce5091 Fixed typo 2020-06-01 20:54:29 -03:00
Claudio Sanches b4ab40ae34 Adds a prompt to confirm if should run tools in the Status page. 2020-06-01 18:56:38 -03:00
Claudio Sanches 2acc24f489 Added missing trailing slash 2020-05-26 17:23:37 -03:00
vedanshujain e89ee25f36 Better option names to properly describe their intention.
Additionally, allow an option in `verify_base_tables` to call `create_table` method. This will be useful if someone wants to fix the their database.
2020-05-26 23:26:45 +05:30
Claudio Sanches a240798362 Don't allow redirection while checking for uploads directory 2020-05-25 10:31:58 -03:00
vedanshujain fafa44bde0 Modified notice to also handle when REST API does not have verify tool. 2020-05-22 18:32:03 +05:30
vedanshujain f5afddd4c9 Add support for notices 2020-05-22 18:32:03 +05:30
vedanshujain 3acc03c804 Add `verify_base_db` method to check if all base tables are present.
Optionally, also adds a notice in case all db tables are not present. Returns list of tables.

Note that we only check missing tables and don't care about exact table structure because many time tables are modified by merchants to better suit their needs (indexes, collations etc).
2020-05-22 18:30:11 +05:30
Christopher Allford 93811e0a56
Merge pull request #25753 from woocommerce/fix/25752-wc_get_shipping_method_count-check-enabled
Add is_enabled=1 check in wc_get_shipping_method_count()
2020-05-21 11:44:36 -07:00
Viktor Szépe 90c34a26a0
Fix PHPDoc in WC_Notes_Run_Db_Update
and correct a newbie mistake
2020-05-19 19:21:57 +02:00
Vedanshu Jain 7fb1079137
Merge pull request #26399 from woocommerce/fix/uploads_htaccess
Disable directory listing for redirect download method
2020-05-19 15:56:37 +05:30