From 2ee6394d279f51c80e4dd92bc2a316a285385f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Meyer?= Date: Mon, 17 Jul 2023 11:42:15 +0200 Subject: [PATCH] feat(poc): test something --- lib/shopware/api.ts | 3 ++- lib/shopware/index.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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);