Auto remove Sale product category from not on sale products in Woocommerce
问题 In woocommerce I am using the code from this answer thread that assign a "Sale" product category to a product that is on sale (so with an active sale price) . I have tried to remove "Sale" product category when the product is not on sale anymore without success. Is it possible to automatically remove products from the "Sale" category when they are not anymore on sale? 回答1: The following version code will automatically remove products from the "Sale" category when they are not anymore on sale: