Add: Diagnostic logging for variant selection in TeleBot

Added logging to diagnose why orders are created with £0 pricing:
- Log when product has variants and variant selection is shown
- Log WARNING when product has no variants and base price is used
- Helps identify if variants are missing or not being detected

Troubleshooting: Orders showing £0 despite variants having correct prices

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
SysAdmin 2025-10-08 18:49:45 +01:00
parent 062916d5ce
commit aa06f420fe

View File

@ -599,11 +599,14 @@ namespace TeleBot.Handlers
// If variants exist, show variant selection with quickbuy flow
if (product.Variants?.Any() == true)
{
_logger.LogInformation("Product {ProductId} has {Count} variants, showing selection", productId, product.Variants.Count);
await ShowVariantSelectionForQuickBuy(bot, callbackQuery.Message!, session, product, quantity);
return;
}
// Add to cart with base product
// Add to cart with base product (ONLY if no variants)
_logger.LogWarning("Quick buy for product {ProductId} ({Name}) with NO variants - using base price £{Price}",
productId, product.Name, product.Price);
session.Cart.AddItem(productId, product.Name, product.Price, quantity, null, null);
// Track quick buy action