Conditionally set cart item prices for specific products in WooCommerce 3
In WooCommerce I am using some code from this answer: Set WooCommerce cart item price to zero if the product has already been bought It works great with one product, but I would like to make it work with several products . So the code below, for a specific product, change the cart item price to $0.00 if customer has already purchased and if not the price is set to $100 (for the first purchase) : add_action( 'woocommerce_before_calculate_totals', 'conditionally_change_cart_items_price', 10, 1 ); function conditionally_change_cart_items_price( $cart_object ) { if ( is_admin() && ! defined(