src/Cart/ShoppingCart.php
public function getCorrectBuyable(Buyable $buyable)
    {
        if ($buyable instanceof Product
            && $buyable->hasExtension(ProductVariationsExtension::class)
            && $buyable->Variations()->count() > 0
        ) {
            foreach ($buyable->Variations() as $variation) {
                if ($variation->canPurchase()) {
                    return $variation;
                }
            }
        }

        return $buyable;
    }
public function getCorrectBuyable(Buyable $buyable)
    {
        if ($buyable instanceof Product
            && $buyable->hasExtension(ProductVariationsExtension::class)
            && $buyable->Variations()->count() > 0
        ) {
            foreach ($buyable->Variations() as $variation) {
                if ($variation->canPurchase()) {
                    return $variation;
                }
            }
        }

        return $buyable;
    }
Ensure the proper buyable will be returned for a given buyable…
This is being used to ensure a product with variations cannot be added to the cart…
a Variation has to be added instead!

@param  Buyable $buyable
@return Buyable