[x] I have confirmed this occurs in the most recent version of WordPress, WooCommerce, and Facebook for WooCommerce.
[x] I have confirmed this occurs when only WooCommerce and Facebook for WooCommerce are active and when using a default WordPress or WooCommerce theme.
Product Sets - The excluded categories warning is always displayed, I'll add an issue pointing to this issue shortly.
πΆββοΈ Steps to reproduce
Connect FB and exclude a category with products.
Create a product set that includes the excluded category.
The JS alert You have selected one or more categories currently excluded from the Facebook sync. Products belonging to the excluded categories will not be added to your Facebook Product Set. displays.
Create another product set containing a NON-excluded category.
The JS alert still displays.
βοΈ Expected behavior
The JS alert should only display if an excluded category is actually included in the product set.
π Isolate the bug
βοΈ Describe the bug
πΆββοΈ Steps to reproduce
You have selected one or more categories currently excluded from the Facebook sync. Products belonging to the excluded categories will not be added to your Facebook Product Set.
displays.βοΈ Expected behavior
The JS alert should only display if an excluded category is actually included in the product set.
π§ Solution
The culprit is the comparison in this function: https://github.com/woocommerce/facebook-for-woocommerce/blob/2eab66267d706fc46beed78e2c7506ccc347130f/assets/js/admin/product-sets-admin.js#L58-L68
Obviously,
excludedCategories[i]
will always be in theexcludedCategories
array! π