diff --git a/Helper/Data.php b/Helper/Data.php new file mode 100644 index 00000000..7222f185 --- /dev/null +++ b/Helper/Data.php @@ -0,0 +1,47 @@ +_helperPage = $page; + parent::__construct($context); + } + + public function getInformationPageUrl() { + + return $this->_helperPage->getPageUrl((string) $this->scopeConfig->getValue( + self::CONFIG_PATH_GENERAL_INFORMATION_PAGE, + ScopeInterface::SCOPE_STORE + )) ?? '#'; + } + + public function getNewsletterCheckboxLabelConfig() { + + return $this->scopeConfig->getValue(self::CONFIG_PATH_GENERAL_NEWSLETTER_CHECKBOX_LABEL,ScopeInterface::SCOPE_STORE); + } + + public function getCheckboxLabel() { + return __($this->getNewsletterCheckboxLabelConfig(), $this->getInformationPageUrl()); + } + + + +} diff --git a/etc/adminhtml/system/general.xml b/etc/adminhtml/system/general.xml index 39db7645..12cbdbc7 100644 --- a/etc/adminhtml/system/general.xml +++ b/etc/adminhtml/system/general.xml @@ -36,6 +36,23 @@ gdpr/general/block_id + + + Enable Privacy Policy Checkbox Confirm for Magento Newsletter form + Magento\Config\Model\Config\Source\Enabledisable + + 1 + + gdpr/general/newsletter_checkbox + + + + + + 1 + + gdpr/general/newsletter_checkbox_label + diff --git a/etc/config.xml b/etc/config.xml index b03705ce..cc0ef69b 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -11,6 +11,7 @@ 0 privacy-policy-cookie-restriction-mode + Privacy Policy]]> diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 396e1ab7..9cd6b85f 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -214,3 +214,6 @@ ID,ID State,State Message,Message "Privacy Settings","Privacy Settings" +"Newsletter Checkbox Label","Newsletter Checkbox Label" +"Enable Privacy Policy Checkbox Confirm for Magento Newsletter form","Enable Privacy Policy Checkbox Confirm for Magento Newsletter form" +"Newsletter Checkbox","Newsletter Checkbox" diff --git a/i18n/it_IT.csv b/i18n/it_IT.csv index 5fea2efc..162dab32 100644 --- a/i18n/it_IT.csv +++ b/i18n/it_IT.csv @@ -213,4 +213,7 @@ "Performed At","Eseguito il" "State","Stato" "Message","Messaggio" -"Privacy Settings","Impostazioni Privacy" \ No newline at end of file +"Privacy Settings","Impostazioni Privacy" +"Newsletter Checkbox Label","Label checkbox newsletter" +"Enable Privacy Policy Checkbox Confirm for Magento Newsletter form","Abilita la checkbox per la privacy policy della newsletter di Magento" +"Newsletter Checkbox","Checkbox Newsletter" diff --git a/view/frontend/layout/default.xml b/view/frontend/layout/default.xml index 011484dd..b4299f6b 100644 --- a/view/frontend/layout/default.xml +++ b/view/frontend/layout/default.xml @@ -27,5 +27,10 @@ + + + Opengento_Gdpr::newsletter/subscribe.phtml + + diff --git a/view/frontend/templates/newsletter/subscribe.phtml b/view/frontend/templates/newsletter/subscribe.phtml new file mode 100644 index 00000000..8a9f8700 --- /dev/null +++ b/view/frontend/templates/newsletter/subscribe.phtml @@ -0,0 +1,61 @@ +helper('Opengento\Gdpr\Helper\Data'); + +?> +
+
escapeHtml(__('Newsletter')) ?>
+
+ +
+
+ diff --git a/view/frontend/web/css/source/_module.less b/view/frontend/web/css/source/_module.less index cdb9d475..1e83e4c6 100644 --- a/view/frontend/web/css/source/_module.less +++ b/view/frontend/web/css/source/_module.less @@ -23,6 +23,15 @@ } } } + .block.newsletter { + .privacy-check { + padding-top: 5px; + input { + height: auto; + padding-left: 0; + } + } + } .enhanced-privacy-popup { position: fixed;