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 <noreply@anthropic.com>
This commit is contained in:
2026-06-17 00:52:46 +00:00
parent a2bc87e947
commit 69f09a257c
+2 -1
View File
@@ -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(