diff --git a/.changeset/rotten-balloons-think.md b/.changeset/rotten-balloons-think.md new file mode 100644 index 0000000000..430df9e2d6 --- /dev/null +++ b/.changeset/rotten-balloons-think.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/magento-category': patch +--- + +Fixed a bug where pagination would be added when navigating to a subcategory from a paginated page diff --git a/packages/magento-category/components/CategoryChildren/CategoryChildren.tsx b/packages/magento-category/components/CategoryChildren/CategoryChildren.tsx index bd4c1393b3..30a79c1aaa 100644 --- a/packages/magento-category/components/CategoryChildren/CategoryChildren.tsx +++ b/packages/magento-category/components/CategoryChildren/CategoryChildren.tsx @@ -17,6 +17,8 @@ const { classes } = extendableComponent(name, parts) export function CategoryChildren(props: CategoryChildrenProps) { const { children, params, sx = [] } = props + const { currentPage, ...paramsWithoutCurrentPage } = params + if (!children || children.length === 0) return null return ( @@ -46,7 +48,7 @@ export function CategoryChildren(props: CategoryChildrenProps) { underline='none' color='inherit' href={productListLink({ - ...params, + ...paramsWithoutCurrentPage, url: cat.url_path, filters: { category_uid: { eq: cat.uid } }, })}