woocommerce / woocommerce-product-tables-feature-plugin

Implements new data-stores and moves product data into custom tables, with a new, normalised data structure.
GNU General Public License v3.0
192 stars 32 forks source link

Clear backwards compatibility cache when clearing product data store caches #85

Closed rodrigoprimo closed 6 years ago

rodrigoprimo commented 6 years ago

This commit adds code to clean the backwards compatibility cache created for each product on WC_Product_Tables_Backwards_Compatibility::get_from_product_table() whenever a product is changed and WC_Product_Data_Store_Custom_Table::clear_caches() is called. To be able to do this it was necessary to change the way the backwards compatibility class caches information. Instead of creating a cache entry for each product property, now the class will create a cache entry for each product. So now all product properties are now stored in the same cache entry.

This change fixes two failing tests. Fixes #75

cc @claudiulodro

claudiulodro commented 6 years ago

Good idea. Works well. 👍