From 69f09a257c083a3ed698e74898e03db419f750aa Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Wed, 17 Jun 2026 00:52:46 +0000 Subject: [PATCH] Fix doubled category suffix in merchant feed titles Product names already include 'Whole Bean Coffee' / 'Ground Coffee' so appending the category label was doubling the suffix. Now only appends if the product name doesn't already contain 'coffee'. Co-Authored-By: Claude Sonnet 4.6 --- merchant-feed.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/merchant-feed.php b/merchant-feed.php index dc95fba..296ba78 100644 --- a/merchant-feed.php +++ b/merchant-feed.php @@ -34,7 +34,8 @@ foreach ($products as $p) { $grindNote = $p['category'] === 'Bean' ? 'Available as whole bean so you can grind fresh for maximum flavor.' : 'Pre-ground to a versatile medium grind, ready to brew right out of the bag.'; - $title = htmlspecialchars($p['name'] . ' ' . $categoryLabel . ' Coffee'); + $nameSuffix = stripos($p['name'], 'coffee') !== false ? '' : ' ' . $categoryLabel . ' Coffee'; + $title = htmlspecialchars($p['name'] . $nameSuffix); $rawDesc = $p['description'] ?? ''; if (!empty($rawDesc)) { $desc = htmlspecialchars(