fix(core-flows): use product title for line item title (#12397)
* fix(core-flows): use prduct title for line item title * fix: module tests * fix: http tests * fix: display item subtitle instead of prod title as secondary text in line item * fix: claim/exchange items
This commit is contained in:
@@ -679,7 +679,7 @@ medusaIntegrationTestRunner({
|
||||
unit_price: 1500,
|
||||
compare_at_unit_price: null,
|
||||
is_tax_inclusive: true,
|
||||
title: "S / Black",
|
||||
title: "Medusa T-Shirt",
|
||||
quantity: 2,
|
||||
tax_lines: [
|
||||
expect.objectContaining({
|
||||
@@ -714,7 +714,7 @@ medusaIntegrationTestRunner({
|
||||
compare_at_unit_price: null,
|
||||
is_tax_inclusive: true,
|
||||
quantity: 2,
|
||||
title: "S / Black",
|
||||
title: "Medusa T-Shirt",
|
||||
tax_lines: [
|
||||
expect.objectContaining({
|
||||
description: "CA Default Rate",
|
||||
@@ -729,7 +729,7 @@ medusaIntegrationTestRunner({
|
||||
compare_at_unit_price: null,
|
||||
is_tax_inclusive: true,
|
||||
quantity: 1,
|
||||
title: "S / White",
|
||||
title: "Medusa T-Shirt",
|
||||
tax_lines: [
|
||||
expect.objectContaining({
|
||||
description: "CA Default Rate",
|
||||
@@ -1603,11 +1603,11 @@ medusaIntegrationTestRunner({
|
||||
expect.objectContaining({
|
||||
items: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
title: "2-pack",
|
||||
subtitle: "2-pack",
|
||||
quantity: 1,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
title: "3-pack",
|
||||
subtitle: "3-pack",
|
||||
quantity: 1,
|
||||
}),
|
||||
]),
|
||||
|
||||
@@ -1668,8 +1668,8 @@ medusaIntegrationTestRunner({
|
||||
is_custom_price: false,
|
||||
quantity: 1,
|
||||
requires_shipping: false, // product doesn't have a shipping profile nor inventory items that require shipping
|
||||
subtitle: "Test product",
|
||||
title: "Test variant",
|
||||
title: "Test product",
|
||||
subtitle: "Test variant",
|
||||
unit_price: 3000,
|
||||
updated_at: expect.any(Date),
|
||||
}),
|
||||
@@ -1719,8 +1719,8 @@ medusaIntegrationTestRunner({
|
||||
is_custom_price: false,
|
||||
quantity: 1,
|
||||
requires_shipping: false,
|
||||
subtitle: "Test product",
|
||||
title: "Test variant",
|
||||
title: "Test product",
|
||||
subtitle: "Test variant",
|
||||
unit_price: 2000,
|
||||
updated_at: expect.any(Date),
|
||||
}),
|
||||
@@ -1841,7 +1841,8 @@ medusaIntegrationTestRunner({
|
||||
unit_price: 3000,
|
||||
is_tax_inclusive: true,
|
||||
quantity: 1,
|
||||
title: "Test variant",
|
||||
title: "Test product",
|
||||
subtitle: "Test variant",
|
||||
}),
|
||||
]),
|
||||
})
|
||||
@@ -2093,7 +2094,8 @@ medusaIntegrationTestRunner({
|
||||
unit_price: 1500,
|
||||
is_tax_inclusive: true,
|
||||
quantity: 1,
|
||||
title: "Test variant",
|
||||
title: "Test product",
|
||||
subtitle: "Test variant",
|
||||
}),
|
||||
]),
|
||||
})
|
||||
@@ -2322,7 +2324,7 @@ medusaIntegrationTestRunner({
|
||||
unit_price: 3000,
|
||||
is_tax_inclusive: true,
|
||||
quantity: 1,
|
||||
title: "Test variant",
|
||||
title: "Test product",
|
||||
}),
|
||||
]),
|
||||
})
|
||||
@@ -2478,7 +2480,7 @@ medusaIntegrationTestRunner({
|
||||
unit_price: 3000,
|
||||
is_tax_inclusive: true,
|
||||
quantity: 1,
|
||||
title: "Test variant",
|
||||
title: "Test product",
|
||||
}),
|
||||
]),
|
||||
})
|
||||
@@ -2566,7 +2568,7 @@ medusaIntegrationTestRunner({
|
||||
quantity: 1,
|
||||
unit_price: 5000,
|
||||
is_custom_price: true,
|
||||
title: "Test variant",
|
||||
title: "Test product",
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -2600,7 +2602,7 @@ medusaIntegrationTestRunner({
|
||||
unit_price: 5000,
|
||||
is_custom_price: true,
|
||||
quantity: 2,
|
||||
title: "Test variant",
|
||||
title: "Test product",
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
@@ -776,7 +776,7 @@ medusaIntegrationTestRunner({
|
||||
expect.objectContaining({
|
||||
unit_price: 1500,
|
||||
quantity: 2,
|
||||
title: "S / Black",
|
||||
title: product.title,
|
||||
}),
|
||||
],
|
||||
subtotal: 3000,
|
||||
@@ -805,12 +805,12 @@ medusaIntegrationTestRunner({
|
||||
expect.objectContaining({
|
||||
unit_price: 1500,
|
||||
quantity: 2,
|
||||
title: "S / Black",
|
||||
title: product.title,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
unit_price: 1500,
|
||||
quantity: 1,
|
||||
title: "S / Black",
|
||||
title: product.title,
|
||||
}),
|
||||
]),
|
||||
subtotal: 4500,
|
||||
|
||||
@@ -246,8 +246,8 @@ medusaIntegrationTestRunner({
|
||||
}),
|
||||
items: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
title: "Test variant",
|
||||
subtitle: "Test product",
|
||||
title: "Test product",
|
||||
subtitle: "Test variant",
|
||||
product_title: "Test product",
|
||||
product_description: null,
|
||||
product_subtitle: null,
|
||||
@@ -313,8 +313,8 @@ medusaIntegrationTestRunner({
|
||||
}),
|
||||
}),
|
||||
expect.objectContaining({
|
||||
title: "Variant variable",
|
||||
subtitle: "Another product",
|
||||
title: "Another product",
|
||||
subtitle: "Variant variable",
|
||||
raw_unit_price: expect.objectContaining({
|
||||
value: "200",
|
||||
}),
|
||||
|
||||
@@ -49,7 +49,7 @@ function ClaimOutboundItem({
|
||||
)}
|
||||
</div>
|
||||
<Text as="div" className="text-ui-fg-subtle txt-small">
|
||||
{previewItem.product_title}
|
||||
{previewItem.subtitle}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -137,7 +137,7 @@ function OrderEditItem({ item, currencyCode, orderId }: OrderEditItemProps) {
|
||||
{item.variant_sku && <span>({item.variant_sku})</span>}
|
||||
</div>
|
||||
<Text as="div" className="text-ui-fg-subtle txt-small">
|
||||
{item.product_title}
|
||||
{item.subtitle}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,7 +49,7 @@ function ExchangeOutboundItem({
|
||||
)}
|
||||
</div>
|
||||
<Text as="div" className="text-ui-fg-subtle txt-small">
|
||||
{previewItem.product_title}
|
||||
{previewItem.subtitle}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -127,8 +127,8 @@ export function prepareLineItemData(data: PrepareLineItemDataInput) {
|
||||
|
||||
let lineItem: any = {
|
||||
quantity: item?.quantity,
|
||||
title: variant?.title ?? item?.title,
|
||||
subtitle: variant?.product?.title ?? item?.subtitle,
|
||||
title: variant?.product?.title ?? item?.title,
|
||||
subtitle: variant?.title ?? item?.subtitle,
|
||||
thumbnail: variant?.product?.thumbnail ?? item?.thumbnail,
|
||||
|
||||
product_id: variant?.product?.id ?? item?.product_id,
|
||||
|
||||
Reference in New Issue
Block a user