Added setup instructions to create and enable the product attributes lookup table.

Néstor Soriano 2021-07-27 10:25:06 +02:00
parent 2caadce058
commit bb8bdc467b
1 changed files with 31 additions and 5 deletions

@ -236,14 +236,40 @@ When using the testing instructions below, test only those cases presented in th
## WooCommerce Core Updates:
### Setup the product attributes lookup table feature (prerequisite for testing #30041)
1. Add the following snippet [using the code snippets plugin](https://wordpress.org/plugins/code-snippets/):
```php
add_action('woocommerce_init', function() {
wc_get_container()
->get(\Automattic\WooCommerce\Internal\ProductAttributesLookup\LookupDataStore::class)
->show_feature();
});
```
2. Go to the _WooCommerce - Status - Tools_ page. You will see a new tool with the title "Create and fill product attributes lookup table":
![](https://user-images.githubusercontent.com/937723/116562476-794cbb80-a903-11eb-9f77-1acb0a788793.png)
3. Click the "Create" button. After the page reloads you'll see that the button is disabled and shows a number corresponding to the number of products processed so far (the table is filled in increments using scheduled actions):
![](https://user-images.githubusercontent.com/937723/116562758-bc0e9380-a903-11eb-8663-ba1f07e1c28b.png)
4. Remove the `&action=regenerate_product_attributes_lookup_table` part from the page URL and reload it until the button changes to "Regenerate" and is enabled again. At this point the table is ready for use.
![](https://user-images.githubusercontent.com/937723/125607277-b5a9d837-0779-423c-b276-0e1429518f2a.png)
5. Go to _WooCommerce - Settings - Products - Advanced_. Mark the "Use the product attributes lookup table for filtering" option and save.
![](https://user-images.githubusercontent.com/937723/124109557-90c13580-da67-11eb-8d17-50fd348455eb.png)
### Sync the product attributes lookup table on product creation/change/deletion #30041
1. Setup some additional products, use this csv file https://raw.githubusercontent.com/woocommerce/woocommerce/dbac025535e29f5f67bdd96ba256ca4531662b4e/DATA_FOR_POC/FilterByAttributeUsingLookup_Products.csv
2. Trash a variable product
3. Go to WooCommerce - Settings - Products - Advanced.
4. Check the "Enable table usage" option and save changes.
![](https://user-images.githubusercontent.com/937723/124109557-90c13580-da67-11eb-8d17-50fd348455eb.png)
5. Create/delete/modify products and variations as follows and verify that everything continues working.
3. Create/delete/modify products and variations as follows and verify that everything continues working.
* A new product is created
* A new variation is added to a product
* A product or variation that had been trashed previously is untrashed
@ -253,7 +279,7 @@ When using the testing instructions below, test only those cases presented in th
* Terms are added or removed from the attribute definition for a product
* The attribute changes between "used for variations" and not
* The attributes for a variation change
6. Delete the lookup table (from the WooCommerce > Status > Tools page)
4. Delete the lookup table (from the WooCommerce > Status > Tools page)
### Fixing batch export limitations #29749