Skip to content

Commit 9baa66a

Browse files
committed
fix the store id #1847 for magento 2.3.6-p1
1 parent 6cfe89a commit 9baa66a

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

Model/Plugin/Subscriber.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function beforeUnsubscribeCustomerById(
6666
\Magento\Newsletter\Model\Subscriber $subscriber,
6767
$customerId
6868
) {
69-
$storeId = $this->getStoreIdFromSubscriber($subscriber);
69+
$storeId = $this->_storeManager->getStore()->getId();
7070
if ($this->_helper->isMailChimpEnabled($storeId)) {
7171
if (!$this->_helper->getConfigValue(\Ebizmarts\MailChimp\Helper\Data::XML_MAGENTO_MAIL, $storeId)) {
7272
$subscriber->setImportMode(true);
@@ -101,8 +101,7 @@ public function beforeSubscribeCustomerById(
101101
\Magento\Newsletter\Model\Subscriber $subscriber,
102102
$customerId
103103
) {
104-
105-
$storeId = $this->getStoreIdFromSubscriber($subscriber);
104+
$storeId = $this->_storeManager->getStore()->getId();
106105
if ($this->_helper->isMailChimpEnabled($storeId)) {
107106
$subscriber->loadByCustomerId($customerId);
108107
if (!$subscriber->isSubscribed()) {
@@ -154,7 +153,6 @@ public function beforeSubscribe(
154153
\Magento\Newsletter\Model\Subscriber $subscriber,
155154
$email
156155
) {
157-
//$websiteId = $this->getStoreIdFromSubscriber($subscriber);
158156
$storeId = $this->_storeManager->getStore()->getId();
159157
if ($this->_helper->isMailChimpEnabled($storeId)) {
160158
if (!$this->_helper->getConfigValue(\Ebizmarts\MailChimp\Helper\Data::XML_MAGENTO_MAIL, $storeId)) {
@@ -203,7 +201,7 @@ public function beforeSubscribe(
203201
public function beforeUnsubscribe(
204202
\Magento\Newsletter\Model\Subscriber $subscriber
205203
) {
206-
$storeId = $this->getStoreIdFromSubscriber($subscriber);
204+
$storeId = $this->_storeManager->getStore()->getId();
207205
if ($this->_helper->isMailChimpEnabled($storeId)) {
208206
if (!$this->_helper->getConfigValue(\Ebizmarts\MailChimp\Helper\Data::XML_MAGENTO_MAIL, $storeId)) {
209207
$subscriber->setImportMode(true);
@@ -230,8 +228,7 @@ public function beforeUnsubscribe(
230228
public function afterDelete(
231229
\Magento\Newsletter\Model\Subscriber $subscriber
232230
) {
233-
234-
$storeId = $this->getStoreIdFromSubscriber($subscriber);
231+
$storeId = $this->_storeManager->getStore()->getId();
235232
if ($this->_helper->isMailChimpEnabled($storeId)) {
236233
$api = $this->_helper->getApi($storeId);
237234
if ($subscriber->isSubscribed()) {
@@ -254,13 +251,4 @@ public function afterDelete(
254251
}
255252
return null;
256253
}
257-
258-
/**
259-
* @param \Magento\Newsletter\Model\Subscriber $subscriber
260-
* @return int
261-
*/
262-
protected function getStoreIdFromSubscriber(\Magento\Newsletter\Model\Subscriber $subscriber)
263-
{
264-
return $subscriber->getStoreId();
265-
}
266254
}

view/frontend/templates/footerwphone.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
data-validate="{required:true, 'validate-email':true}"
2020
/>
2121
<input name="phone" type="tel" id="newsletter"
22-
placeholder="<?= $block->escapeHtml(__('Enter your phone')) ?>"
22+
placeholder="<?= $block->escapeHtml(__('Enter your SMS phone')) ?>"
2323
data-mage-init='{"mage/trim-input":{}}'
24-
data-validate="{required:true, 'validate-phoneStrict':false}"
24+
data-validate="{required:false, 'validate-phoneStrict':false}"
2525
/>
2626
</label>
2727
</div>

0 commit comments

Comments
 (0)