Commit Graph

38388 Commits

Author SHA1 Message Date
Nestor Soriano eb2e67d17d
Make the debug tools page entries for attribute filtering hidden by default.
To show the entries the following needs to be run:

wc_get_container()
->get(\Automattic\WooCommerce\Internal\ProductAttributesLookup\LookupDataStore::class)
->show_feature();
2021-05-10 11:32:39 +02:00
Nestor Soriano cdc55bf846
Fix typos in comments 2021-05-07 09:16:45 +02:00
Nestor Soriano 9dcdfddc15
Fix table creation detection in DataRegeneratorTest 2021-05-05 11:50:43 +02:00
Nestor Soriano f53f959d03
Fix the usage of FakeQueue in DataRegeneratorTest.
Also update the doc comment of FakeQueue itself on how to use it.
2021-05-05 11:11:36 +02:00
Nestor Soriano c4e7074c70
Add unit tests for the DataRegenerator class 2021-05-04 16:15:16 +02:00
Nestor Soriano 4d13b0ca07
ExtendedContainer::replace now allows registering anonymous classes. 2021-05-04 16:14:34 +02:00
Nestor Soriano 6820b6e519
Add the WC_Queue::reset_instance method 2021-05-04 16:13:48 +02:00
Nestor Soriano 42245ed92a
Add unit tests for LookupDataStore::update_data_for_product (variable products) 2021-05-03 11:14:33 +02:00
Nestor Soriano 467af94b1d
Add unit tests for LookupDataStore::update_data_for_product (simple products)
Also:

- Add the FakeQueue class
- Fix LookupDataStore, it was using a hardcoded "wp_" lookup table name
2021-04-30 12:10:25 +02:00
Nestor Soriano e58d26f377
Fix: using "current" on a possibly "false" value. 2021-04-29 16:46:41 +02:00
Nestor Soriano 44cf1648d5
DataRegenerator: show lookup table filling process in tools page.
The status is displayed in the disabled "Regenerate table" button
as follows: "Filling in progress (X)", where X is the number of
products processed so far.
2021-04-29 11:49:43 +02:00
Nestor Soriano 7f2c2d8b72
Add logging for errors during the execution of a debug tool. 2021-04-29 11:20:25 +02:00
Nestor Soriano eb7fb42888
Add a new debug tools page entry to delete the lookup table.
Also, use $wpdb->prefix instead of hardcoded "wp_" for the table name.
2021-04-29 10:57:31 +02:00
Nestor Soriano 83fed1eab5
Implement the LookupDataStore::create_lookup_table_entries_for_variable_product method. 2021-04-28 16:57:47 +02:00
Nestor Soriano 94f5dfaa11
Make the DataRegenerator::delete_all_attributes_lookup_data method public. 2021-04-28 16:56:29 +02:00
Nestor Soriano 21053afec1
Partially implement LookupDataStore::update_data_for_product
For now it only creates data for non-variable products.
2021-04-28 12:25:56 +02:00
Nestor Soriano d1744ac99a
Add the ProductAttributesLookup\DataRegenerator class.
This class creates and fills the product attributes lookup table
from the existing products. It does so by in small chunks by using
Action Scheduler; it handles all the batches and the scheduling
by itself.

It also adds two entries to the debug tools menu:

- Initiate lookup table regeneration (deleting the existing table first)
- Enable or disable the actual usage of the lookup table
  for product filtering

The first one is the only way to generate the lookup table for now
(there's no explicit data migration).

The actual filling of the table is delegated to a LookupDataStore class
that is not implemented yet, so for now the table isn't actually filled.
Also enabling/disabling the lookup table usage has no real effect yet.
2021-04-28 10:30:11 +02:00
Nestor Soriano 10adec6b88
Improvements in the engine behind the debug tools page.
Two new optional keys have been added to the tool definition array:

- 'disabled': when true the tool button will appear disabled.
- 'needs_refresh': when running a tool, by default the tool definitions
  are retrieved first, then the selected tool is executed,
  then the definitions previously retrieved are rendered.
  When this key is true the tool definitions are retrieved again
  after execution, useful for cases where the tool description
  or button enable/disable state changes after the tool execution.

Also now if a tool execution throws an exception a notice will be
shown with the execption message, previously the exception
was unhandled.
2021-04-28 10:24:23 +02:00
Nestor Soriano bad3df3e23
Fix code sniffer errors 2021-04-28 09:36:10 +02:00
Roy Ho aab56d84e0
Merge pull request #29752 from woocommerce/fix/29730
Set USD as default store currency
2021-04-23 13:29:34 -07:00
Jonathan Sadowski cd7b8ee30f Fix unit tests for new default USD currency 2021-04-23 10:03:05 -05:00
Jonathan Sadowski 55ab8cb966 Set USD as default store currency 2021-04-23 09:29:12 -05:00
Roy Ho 03d4d4893e
Merge pull request #28187 from woocommerce/fix/25900-take-2
Fix: image size customisation controls not shown when theme doesn't define them but Woo core does
2021-04-22 05:41:57 -07:00
Vedanshu Jain 0df1d3ef64
Merge pull request #29599 from woocommerce/enhancement/email-setting-help-text
Change the help text in email settings to include debugging steps.
2021-04-21 22:15:55 +05:30
Nestor Soriano 3a895c9eed
Move ThemeSupport class to Internal namespace, and use in 2021 theme. 2021-04-21 12:57:56 +02:00
vedanshujain 96f1ccfe61 Use encoding instead of direct quote character to follow WP guideline. 2021-04-21 11:29:25 +05:30
vedanshujain 00a0118858 Improvements in text for translators. 2021-04-21 11:29:25 +05:30
Gracie Ofslager 43a502e185 Update class-wc-settings-emails.php
Adding copy to line 54 for instructions on how to ensure email is delivered successfully and linking to troubleshooting documentation.
2021-04-21 11:29:25 +05:30
Roy Ho e4fec5b914
Merge pull request #29721 from woocommerce/fix/29525
Modify wc_get_low_stock_amount function to always return a number
2021-04-20 11:56:27 -07:00
Nestor Soriano b88eb4c981
Rename "assertIsInt" to "assertIsInteger" and make it static
- Renaming to prevent conflicts with the existing method in
  the newer PHPUnit used in PHP 8.
- Making it static because "assertIsInt" is static too, so it'll be
  easier to replace in the future.
2021-04-20 17:16:59 +02:00
Nestor Soriano d214eab157
Use int cast instead of intval in wc_get_low_stock_amount 2021-04-20 16:35:42 +02:00
Nestor Soriano d11a20b5b4
Merge branch 'trunk' into fix/25900-take-2 2021-04-20 16:08:45 +02:00
Néstor Soriano a5333ffd1f
Merge pull request #29681 from woocommerce/fix/29540
Fix/29540
2021-04-20 15:50:14 +02:00
roykho 78a57e53ec
Update to use closure per review comment 2021-04-20 06:17:50 -07:00
Nestor Soriano 76a613a5bb
Modify wc_get_low_stock_amount so that it always returns an integer.
Previously, if the product didn't have an explicit low stock value
amount the value of the woocommerce_notify_low_stock_amount option,
which is a string, was returned verbatim.

Also, update related unit tests to create the option value as a string,
and to check that the value returned by woocommerce_notify_low_stock_amount
is always an integer.
2021-04-20 10:17:50 +02:00
Nestor Soriano 1008835488
Fix code sniffer violations in stock functions and its tests 2021-04-20 09:42:07 +02:00
Néstor Soriano 840849ad83
Merge pull request #29718 from woocommerce/fix/package-lock-maint
package lock maintenance
2021-04-19 17:28:47 +02:00
Ron Rennick 94e5991c66 package lock maintenance 2021-04-19 12:15:07 -03:00
Vedanshu Jain 09798c081c
Merge pull request #29699 from woocommerce/add/github-action-to-auto-assign-milestone
Add a GitHub action for automatic assignment of a milestone to merged PRs
2021-04-19 18:25:30 +05:30
Néstor Soriano 3ada9fc562
Change GH API query for milestones to get only the open ones.
Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2021-04-19 14:46:45 +02:00
roykho 98901dc9ec
Merge branch 'trunk' into fix/29540 2021-04-16 13:51:12 -07:00
Barry Hughes 8cef18ab5b
Merge pull request #29702 from woocommerce/add/action-to-build-release-zip-file
Add a GitHub action to manually trigger the generation of a release zip file.
2021-04-16 13:47:56 -07:00
Greg 1b8e0c2b04
Merge pull request #29616 from woocommerce/e2e/e2e-shopper-calculate-shipping
Add new e2e test shopper cart calculate shipping
2021-04-16 14:23:39 -06:00
roykho c73ce8ea04
Convert to using internal DI container 2021-04-16 12:23:40 -07:00
Veljko 1c7bec0489 Remove shipping zones remover 2021-04-16 21:22:34 +02:00
Néstor Soriano 5da39b4ff0
Enclose action step name in double quotes for consistency.
Co-authored-by: Leif Singer <git@singer.sh>
2021-04-16 15:48:38 +02:00
Veljko 23e09d33dd Add shipping zones remover 2021-04-16 14:11:27 +02:00
Vedanshu Jain d79e86932b
Merge pull request #29654 from woocommerce/fix/29499
Set US:CA as the default store location
2021-04-16 16:54:50 +05:30
Nestor Soriano b09ddd7984
Add a GitHub action to manually trigger the generation of a release zip file 2021-04-16 13:06:49 +02:00
Veljko V a2f8216b9b
Merge branch 'trunk' into e2e/e2e-shopper-calculate-shipping 2021-04-16 11:51:52 +02:00