• Hello, I have a quiz that generates at the end a list of products that are added to the cart.
    I want to apply 30% discount on all the cart items if the user buy all those products.
    In the cart.php I know the list of products, so I can set a wc session variable with that information. But that discount should be applied only when all those products are in the cart; if the removes any of it, the discount should be removed as well.
    I also tried with ‘woocommerce_before_calculate_totals’ hook, but I doesn’t help me, because the discounts remain in cart even if the user removes items from that list.
    Can you help me?

  • The topic ‘Custom cart item discounts’ is closed to new replies.