Fixed: Admin is unable to set empty birthday for a customer

This commit is contained in:
Abhishek Kumar
2023-09-18 15:55:29 +05:30
parent c4d30a80ee
commit 0aeb8be718

View File

@@ -966,6 +966,21 @@ class AdminCustomersControllerCore extends AdminController
return parent::processSave();
}
protected function copyFromPost(&$object, $table)
{
parent::copyFromPost($object, $table);
$years = Tools::getValue('years');
$months = Tools::getValue('months');
$days = Tools::getValue('days');
if ($years != '' && $months != '' && $days != '') {
$object->birthday = (int) $years.'-'.(int) $months.'-'.(int) $days;
} elseif ($years == '' && $months == '' && $days == '') {
$object->birthday = null;
}
}
protected function afterDelete($object, $old_id)
{
$customer = new Customer($old_id);