feat: refactor product attributes handling to use product_attribute table and update related models and requests
This commit is contained in:
@@ -112,7 +112,7 @@ class ProductService
|
||||
$this->syncVariantImages($variant, $images);
|
||||
}
|
||||
|
||||
return $variant->load(['product', 'definitions.attribute.options', 'attachments']);
|
||||
return $variant->load(['product', 'definitions.productAttribute.attribute.options', 'attachments']);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ class ProductService
|
||||
$this->syncVariantImages($updatedVariant, $images);
|
||||
}
|
||||
|
||||
return $updatedVariant->load(['product', 'definitions.attribute.options', 'attachments']);
|
||||
return $updatedVariant->load(['product', 'definitions.productAttribute.attribute.options', 'attachments']);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ class ProductService
|
||||
$selectedVariantQuery = $product->variants()
|
||||
->with([
|
||||
'attachments',
|
||||
'definitions.attribute.options',
|
||||
'definitions.productAttribute.attribute.options',
|
||||
]);
|
||||
|
||||
$selectedVariant = $variantId !== null
|
||||
@@ -302,7 +302,7 @@ class ProductService
|
||||
$selectedVariant = $product->variants()
|
||||
->with([
|
||||
'attachments',
|
||||
'definitions.attribute.options',
|
||||
'definitions.productAttribute.attribute.options',
|
||||
])
|
||||
->first();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user