fix(seo): prevent duplicate brand affixes in page titles and add checkout success metadata
Deploy Canina / deploy (push) Successful in 2m30s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 0s

This commit is contained in:
parsa aghaei committed 2026-09-05 19:43:28 +03:30
1 parent c57f775cb4
commit f81aabb479
15 files changed
+9682 -9548

No files matched your search

@@ -1,4 +1,14 @@
import type { Metadata } from 'next';
import OrderSuccess from "../../../../components/OrderSuccess";
import { getPageMetadata } from "../../../../lib/seo";
export async function generateMetadata(): Promise<Metadata> {
return getPageMetadata('checkout_success', {
fallbackTitle: 'سفارش با موفقیت ثبت شد',
fallbackDesc: 'رسید پرداخت و جزئیات ثبت سفارش در کنینا ایران.',
noIndex: true,
});
}
export default async function SuccessPage({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
@@ -21,8 +21,9 @@ export async function generateMetadata(
const nameFa = product.nameFa || product.name;
const nameEn = product.nameEn ? ` (${product.nameEn})` : '';
const rawTitle = `${nameFa}${nameEn}`;
const title = product.metaTitle || formatPageTitle(rawTitle, config.brandNameFa, config.titleSeparator, config.titlePosition, false);
const rawTitle = product.metaTitle || `${nameFa}${nameEn}`;
const title = formatPageTitle(rawTitle, config.brandNameFa, config.titleSeparator, config.titlePosition, false);
const ogTitle = `${title} ${config.titleSeparator} ${config.brandNameFa}`;
const description = product.metaDescription || (product.shortDescription || product.description || '').substring(0, 155).trim() || config.defaultMetaDescription;
const rawKeywords = product.keywords;
@@ -71,7 +72,7 @@ export async function generateMetadata(
},
},
openGraph: {
title,
title: ogTitle,
description,
images: galleryImages,
url: canonicalUrl,
+4 -4
View File
@@ -14,10 +14,10 @@ export async function generateMetadata({
const canonicalPath = category ? `/shop?category=${encodeURIComponent(category)}` : '/shop';
const categoryTitles: Record<string, string> = {
'joints': 'مکمل‌های مفاصل و استخوان سگ و گربه | کنینا ایران',
'immune': 'مکمل‌های تقویت سیستم ایمنی و گوارش پت | کنینا ایران',
'energy': 'ویتامین‌ها و انرژی‌بخش‌های درمانی سگ و گربه | کنینا ایران',
'special-care': 'محصولات مراقبت ویژه پوست، مو و دندان پت | کنینا ایران',
'joints': 'مکمل‌های مفاصل و استخوان سگ و گربه',
'immune': 'مکمل‌های تقویت سیستم ایمنی و گوارش پت',
'energy': 'ویتامین‌ها و انرژی‌بخش‌های درمانی سگ و گربه',
'special-care': 'محصولات مراقبت ویژه پوست، مو و دندان پت',
};
const fallbackTitle = category && categoryTitles[category]