From 53c2541423838dd26c47a39f657de5957849e88a Mon Sep 17 00:00:00 2001 From: Kamil Skibiak Date: Fri, 13 May 2016 22:13:31 +0200 Subject: [PATCH] When out of stock, Email should be required when customer not logged in Make the consistent check whether the email addres should be possible to provide by user - the actions.php controller checks if customer is logged in to decide wheter to take email from parameter or from customer context. This change prevents the scenario whit missing email information when customer has the account but is not logged in when making the request. --- mailalerts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailalerts.php b/mailalerts.php index 5e30f1e..35e0ca3 100644 --- a/mailalerts.php +++ b/mailalerts.php @@ -470,7 +470,7 @@ public function hookActionProductOutOfStock($params) $id_product_attribute = 0; $id_customer = (int)$context->customer->id; - if ((int)$context->customer->id <= 0) + if (!$context->customer->isLogged()) $this->context->smarty->assign('email', 1); elseif (MailAlert::customerHasNotification($id_customer, $id_product, $id_product_attribute, (int)$context->shop->id)) return;