don't delete address if this is address is a default one
This commit is contained in:
@@ -71,4 +71,14 @@ class Address extends BaseAddress {
|
|||||||
$this->dispatchEvent(TheliaEvents::AFTER_DELETEADDRESS, new AddressEvent($this));
|
$this->dispatchEvent(TheliaEvents::AFTER_DELETEADDRESS, new AddressEvent($this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preSave()
|
||||||
|
{
|
||||||
|
$valid = true;
|
||||||
|
if($this->getIsDefault()) {
|
||||||
|
$valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $valid;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user