Set Woocommerce cart item price to zero if the product has already been bought
问题 I am unable to override price on second time purchase. The use case would be: If a user has already bought product "944" then the price would be 0 for next time orders. Meaning, the customer would pay only for first order of that specific product and it would be free for next orders. Here my code: // Enter the ID of the product that shouldn't be purchased again $no_repeats_id = 944; $no_repeats_product = wc_get_product( $no_repeats_id ); // Get the current product to check if purchasing