UI: Remove Variants info button and rename Add to Cart to BUY {PRODUCTNAME}

- Removed informational 'Variants: Size: X options, Color: Y options' button
- Renamed 'Add to Cart' button to 'BUY {product.Name}' for clearer UX
- Applied to both multi-buy single item and regular quantity purchase buttons
This commit is contained in:
SysAdmin 2025-10-06 00:35:30 +01:00
parent 29d677be72
commit 147e96a084

View File

@ -135,7 +135,7 @@ namespace TeleBot.UI
buttons.Add(new[] {
InlineKeyboardButton.WithCallbackData(
$"🛒 Single Item - £{product.Price:F2}",
$"🛒 BUY {product.Name} - £{product.Price:F2}",
singleCallbackData
)
});
@ -152,39 +152,19 @@ namespace TeleBot.UI
buttons.Add(quantityButtons.ToArray());
// Add to cart button
// Buy button
var addCallbackData = hasVariants
? _mapper.BuildCallback("selectvar", product.Id, quantity)
: _mapper.BuildCallback("add", product.Id, quantity);
buttons.Add(new[] {
InlineKeyboardButton.WithCallbackData(
$"🛒 Add to Cart - £{product.Price * quantity:F2}",
$"🛒 BUY {product.Name} - £{product.Price * quantity:F2}",
addCallbackData
)
});
}
// Show variant info if available
if (hasVariants)
{
var variantTypes = product.Variants
.Where(v => v.IsActive)
.GroupBy(v => v.VariantType)
.Select(g => $"{g.Key}: {g.Count()} options")
.ToList();
if (variantTypes.Any())
{
buttons.Add(new[] {
InlineKeyboardButton.WithCallbackData(
$"🎨 Variants: {string.Join(", ", variantTypes)}",
"noop"
)
});
}
}
// Navigation
buttons.Add(new[] { InlineKeyboardButton.WithCallbackData("⬅️ Back to Products", "browse") });