fix: Correctly associate options to variants (#8285)

This commit is contained in:
Stevche Radevski
2024-07-25 17:56:13 +02:00
committed by GitHub
parent eb64ae75a6
commit 639ecdfd74
2 changed files with 67 additions and 1 deletions
@@ -1710,7 +1710,10 @@ export default class ProductModuleService
const variantsWithOptions = variants.map((variant: any) => {
const variantOptions = Object.entries(variant.options ?? {}).map(
([key, val]) => {
const option = options.find((o) => o.title === key)
const option = options.find(
(o) => o.title === key && o.product_id === variant.product_id
)
const optionValue = option?.values?.find(
(v: any) => (v.value?.value ?? v.value) === val
)