mirror of
https://github.com/vercel/commerce.git
synced 2025-05-14 21:47:51 +00:00
feat(poc): fix parent id
This commit is contained in:
parent
46e003196f
commit
b56e4828e3
@ -6,7 +6,7 @@ import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import { useEffect, useState, useTransition } from 'react';
|
||||
|
||||
import LoadingDots from 'components/loading-dots';
|
||||
import { ProductVariant } from 'lib/shopify/types';
|
||||
import { ProductVariant } from 'lib/shopware/types';
|
||||
|
||||
export function AddToCart({
|
||||
variants,
|
||||
|
@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import clsx from 'clsx';
|
||||
import { ProductOption, ProductVariant } from 'lib/shopify/types';
|
||||
import { ProductOption, ProductVariant } from 'lib/shopware/types';
|
||||
import { createUrl } from 'lib/utils';
|
||||
import Link from 'next/link';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
|
@ -129,7 +129,7 @@ export async function getSearchCollectionProducts(params?: {
|
||||
const searchCriteria = { ...criteria, ...sorting };
|
||||
|
||||
const search = await requestSearchCollectionProducts(searchCriteria);
|
||||
if (search) {
|
||||
if (useSeoUrls && search) {
|
||||
search.elements = await changeVariantUrlToParentUrl(search);
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,7 @@ export function transformProduct(item: ExtendedProduct): Product {
|
||||
const productOptions = transformOptions(item);
|
||||
const productVariants = transformVariants(item);
|
||||
|
||||
let path = item.id ? item.id : '';
|
||||
let path = item.parentId ?? item.id ?? '';
|
||||
if (useSeoUrls) {
|
||||
path =
|
||||
item.seoUrls && item.seoUrls.length > 0 && item.seoUrls[0] && item.seoUrls[0].seoPathInfo
|
||||
|
Loading…
x
Reference in New Issue
Block a user