Skip to content

Commit

Permalink
fix(core-flows): line item type collection (medusajs#9251)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-r-l-rodrigues authored and panalgin committed Oct 7, 2024
1 parent 7a22c8f commit ca97a3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/core/core-flows/src/cart/utils/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export const productVariantsFields = [
"product.description",
"product.subtitle",
"product.thumbnail",
"product.type",
"product.collection",
"product.type.value",
"product.collection.title",
"product.handle",
"product.discountable",
"calculated_price.calculated_amount",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,9 @@ export function prepareLineItemData(data: Input) {
product_description:
variant.product.description ?? item?.product_description,
product_subtitle: variant.product.subtitle ?? item?.product_subtitle,
product_type:
variant.product.type?.[0]?.value ?? item?.product_type ?? null,
product_type: variant.product.type?.value ?? item?.product_type ?? null,
product_collection:
variant.product.collection?.[0]?.value ??
item?.product_collection ??
null,
variant.product.collection?.title ?? item?.product_collection ?? null,
product_handle: variant.product.handle ?? item?.product_handle,

variant_id: variant.id,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/core-flows/src/order/utils/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const productVariantsFields = [
"product.description",
"product.subtitle",
"product.thumbnail",
"product.type",
"product.collection",
"product.type.value",
"product.collection.title",
"product.handle",
"calculated_price.calculated_amount",
"inventory_items.inventory_item_id",
Expand Down

0 comments on commit ca97a3c

Please sign in to comment.