Product Save Method Moved To Update Method. Now Getter And Setter Is Cleaned.

This commit is contained in:
devansh bawari 2021-06-22 10:04:11 +05:30
parent 8678d22c9c
commit 8e0724b5cb
1 changed files with 3 additions and 3 deletions

View File

@ -90,15 +90,13 @@ class Configurable extends AbstractType
* Set default variant id.
*
* @param int $defaultVariantId
* @return bool
* @return void
*/
public function setDefaultVariantId($defaultVariantId)
{
$this->product->additional = array_merge($this->product->additional ?? [], [
'default_variant_id' => $defaultVariantId
]);
return $this->product->save();
}
/**
@ -112,6 +110,8 @@ class Configurable extends AbstractType
if ($defaultVariantId) {
$this->setDefaultVariantId($defaultVariantId);
$this->product->save();
}
}