From 23794610d98ac77e2b55fad2c501db999ec0c839 Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Wed, 8 Oct 2025 18:55:57 +0100 Subject: [PATCH] Add: Debug logging for product variant data in TeleBot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log variant count and prices when fetching products to diagnose why variants aren't being detected during add-to-cart flow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- TeleBot/TeleBot/Services/LittleShopService.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/TeleBot/TeleBot/Services/LittleShopService.cs b/TeleBot/TeleBot/Services/LittleShopService.cs index b5f6a72..48ca9c8 100644 --- a/TeleBot/TeleBot/Services/LittleShopService.cs +++ b/TeleBot/TeleBot/Services/LittleShopService.cs @@ -141,11 +141,18 @@ namespace TeleBot.Services { if (!await AuthenticateAsync()) return null; - + var result = await _client.Catalog.GetProductByIdAsync(productId); - + if (result.IsSuccess && result.Data != null && result.Data.IsActive) { + _logger.LogInformation("GetProduct {ProductId}: {Name} | Variants: {Count} | Base Price: £{Price}", + productId, result.Data.Name, result.Data.Variants?.Count ?? 0, result.Data.Price); + if (result.Data.Variants?.Any() == true) + { + _logger.LogInformation(" First variant: {Name} at £{Price}", + result.Data.Variants.First().Name, result.Data.Variants.First().Price); + } return result.Data; }