There are numerous ways to allow your customers to add items to cart. In some instances, it might be sufficient to add a single item to cart. Perhaps you need to allow your customers to add multiple variants? Or maybe you need a really lean and efficient method that doesn't bog down your page loading speeds with unnecessary scripts and bloated JSON data.
Even if this isn't exactly what you're after, it's likely that there's some useful techniques to glean. It's especially useful to be reminded of the importance of taking the time craft a thoughtful UI/UX.