diff --git a/lib/shopware/api.ts b/lib/shopware/api.ts index cfa4f9c3a..377517fe9 100644 --- a/lib/shopware/api.ts +++ b/lib/shopware/api.ts @@ -169,6 +169,7 @@ export async function requestSeoUrl( limit: number = 1 ): Promise { try { + const testing = handle.replace('cms/', '').replace('product/', '').replace('search/', ''); const criteria = { page: page, limit: limit, @@ -176,7 +177,7 @@ export async function requestSeoUrl( { type: 'contains', field: 'seoPathInfo', - value: handle + value: testing } ] }; diff --git a/lib/shopware/index.ts b/lib/shopware/index.ts index fb2d1e4a2..7858d9fa5 100644 --- a/lib/shopware/index.ts +++ b/lib/shopware/index.ts @@ -53,7 +53,7 @@ export async function getMenu(params?: { } export async function getPage(handle: string | []): Promise { - const pageHandle = decodeURIComponent(transformHandle(handle)).replace('cms/', ''); + const pageHandle = decodeURIComponent(transformHandle(handle)); const seoUrlElement = await getFirstSeoUrlElement(pageHandle); if (seoUrlElement) { const category = await getCategory(seoUrlElement);