I am fairly new to WooCommerce so I dont know what could be of use to answer my question, this is why I have not added any codeblocks.
I would like to let customers only add one product to the cart and if they add another product the current product in cart is replaced by the last one.
Do I need to make changes in the code or is it possible with a plugin or WooCommerce setting?
I am looking forward to helpful replies.
Thanks
Add this code your theme
functions.php
file.Hope It's useful !! Enjoy