Merge pull request #1057 from vishal-singh-webkul/gli-2061

Fixed: Wrong customer count after admin bans or deletes the customer on dashboard.
This commit is contained in:
Rohit Jain
2024-07-04 19:57:19 +05:30
committed by GitHub
2 changed files with 13 additions and 1 deletions

View File

@@ -84,11 +84,22 @@ class Blocknewsletter extends Module
'actionCustomerAccountAdd',
'registerGDPRConsent',
'actionExportGDPRData',
'actionDeleteGDPRCustomer'
'actionDeleteGDPRCustomer',
'actionObjectCustomerDeleteAfter',
)
);
}
public function hookActionObjectCustomerDeleteAfter($params)
{
$objCustomer = $params['object'];
if (($register_status = $this->isNewsletterRegistered($objCustomer->email))
&& $register_status > 0
) {
$this->unregister($objCustomer->email, $register_status);
}
}
public function hookActionExportGDPRData($customer)
{
if (!Tools::isEmpty($customer['email']) && Validate::isEmail($customer['email'])) {

View File

@@ -266,6 +266,7 @@ class Dashactivity extends Module
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'customer`
WHERE `date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
AND `deleted` = 0
'.Shop::addSqlRestriction(Shop::SHARE_ORDER)
);