How to enable the combination "3 by 1" in multiple categories of products in Woocommerce?

Hi all,

We recently designed; and they have created multiple categories of products. Using attributes and variables, we have managed to configure the "3 for 1" price in individual products, for example here;

However, we want that people can add several items to their basket, and that a "3 for 1" offer works in their basket if they buy different products and / or different categories.

3 different flavors
2 articles of the Prestige category and 1 article of the Vjuice category.

Both previous examples we would like to qualify for "3 for 1" at fixed and discounted prices.

Please advise, all the answers are very appreciated.