Google Merchant Center trust signal improvements

- Add contact.php (was 404, linked from footer and returns page)
- Add shippingDetails and hasMerchantReturnPolicy to product schema
- Add priceValidUntil to product Offer schema
- Improve merchant feed descriptions (use DB description when present)
- Add handling/transit times and return_policy_label to feed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 18:46:21 +00:00
parent 5637b6d7f5
commit 15bcef262f
3 changed files with 216 additions and 11 deletions
+21 -5
View File
@@ -31,12 +31,22 @@ foreach ($products as $p) {
$imageUrl = !empty($images) ? $base . $images[0] : $base . '/assets/images/placeholder-product.svg';
$categoryLabel = $p['category'] === 'Bean' ? 'Whole Bean' : 'Ground';
$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');
$desc = htmlspecialchars(
$p['name'] . ' flavored artisan coffee — ' . strtolower($categoryLabel) . '. ' .
'All natural flavoring. ' .
'12 oz bag.'
);
$rawDesc = $p['description'] ?? '';
if (!empty($rawDesc)) {
$desc = htmlspecialchars(
strip_tags($rawDesc) . ' ' . $grindNote . ' 12 oz bag. Ships from Weatherford, TX.'
);
} else {
$desc = htmlspecialchars(
"Tom's Java Jive {$p['name']} flavored artisan coffee, freshly roasted in small batches in Weatherford, Texas. " .
"All-natural flavoring with no artificial additives. {$grindNote} " .
"12 oz bag. Free shipping on orders over \$50."
);
}
$link = htmlspecialchars($base . '/product.php?id=' . $p['product_id']);
$imageLink = htmlspecialchars($imageUrl);
$price = number_format((float)($p['sale_price'] ?? $p['price']), 2, '.', '');
@@ -66,11 +76,17 @@ foreach ($products as $p) {
echo " <g:google_product_category>{$gCategory}</g:google_product_category>\n";
echo " <g:product_type>Coffee &gt; Flavored Coffee &gt; {$categoryLabel}</g:product_type>\n";
echo " <g:identifier_exists>false</g:identifier_exists>\n";
echo " <g:custom_label_0>{$categoryLabel}</g:custom_label_0>\n";
echo " <g:shipping>\n";
echo " <g:country>US</g:country>\n";
echo " <g:service>Standard</g:service>\n";
echo " <g:price>5.99 USD</g:price>\n";
echo " <g:min_handling_time>1</g:min_handling_time>\n";
echo " <g:max_handling_time>2</g:max_handling_time>\n";
echo " <g:min_transit_time>3</g:min_transit_time>\n";
echo " <g:max_transit_time>7</g:max_transit_time>\n";
echo " </g:shipping>\n";
echo " <g:return_policy_label>default</g:return_policy_label>\n";
echo " </item>\n";
}