Product Save Method Moved To Update Method. Now Getter And Setter Is Cleaned.
This commit is contained in:
parent
8678d22c9c
commit
8e0724b5cb
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue