In the slow cooker, heat olive oil using the sauté function (if applicable) or in a skillet. Add diced onion and sauté until translucent for about 3-4 minutes. Stir in minced garlic and cook for an additional minute until fragrant.
Add the sautéed onion and garlic mixture to the slow cooker. Pour in the diced tomatoes (with juice) and vegetable broth.
Season the mixture with dried basil, dried oregano, sugar, salt, and pepper. Stir well to combine all ingredients.
Cover the slow cooker and cook on low for 6 hours or on high for 3 hours.
Once the cooking time is complete, if you prefer a smoother texture, use an immersion blender directly in the slow cooker or transfer the soup in batches to a countertop blender. Blend until smooth, then return to the slow cooker (if using a countertop blender).
For a creamier soup, stir in the heavy cream just before serving. Allow the soup to heat through for an additional 10-15 minutes.
Serve the soup hot, garnished with fresh basil leaves if desired.