hotfix(medusa-plugin-segment): Fix sku (#160)
This commit is contained in:
@@ -112,8 +112,13 @@ class SegmentService extends BaseService {
|
|||||||
line_total
|
line_total
|
||||||
)
|
)
|
||||||
|
|
||||||
const skuParts = item.content.variant.sku.split("-")
|
let sku = ""
|
||||||
skuParts.pop()
|
if (item.variant.sku) {
|
||||||
|
let skuParts = item.variant.sku.split("-")
|
||||||
|
skuParts.pop()
|
||||||
|
|
||||||
|
sku = skuParts.join("-")
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
@@ -121,7 +126,7 @@ class SegmentService extends BaseService {
|
|||||||
price: unit_price / 100,
|
price: unit_price / 100,
|
||||||
reporting_revenue: revenue,
|
reporting_revenue: revenue,
|
||||||
product_id: item.variant.product_id,
|
product_id: item.variant.product_id,
|
||||||
sku: item.variant.sku,
|
sku: sku,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user