mirror of
https://github.com/myronblair/tomsjavajive
synced 2026-06-30 17:50:32 -05:00
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:
+2
-1
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user