File tree 1 file changed +26
-6
lines changed
app/code/Magento/Newsletter/Model/ResourceModel 1 file changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -118,17 +118,37 @@ public function loadByEmail($subscriberEmail)
118
118
*/
119
119
public function loadByCustomerData (\Magento \Customer \Api \Data \CustomerInterface $ customer )
120
120
{
121
- $ select = $ this ->connection ->select ()->from ($ this ->getMainTable ())->where ('customer_id=:customer_id ' );
122
-
123
- $ result = $ this ->connection ->fetchRow ($ select , ['customer_id ' => $ customer ->getId ()]);
121
+ $ select = $ this ->connection
122
+ ->select ()
123
+ ->from ($ this ->getMainTable ())
124
+ ->where ('customer_id=:customer_id and store_id=:store_id ' );
125
+
126
+ $ result = $ this ->connection
127
+ ->fetchRow (
128
+ $ select ,
129
+ [
130
+ 'customer_id ' => $ customer ->getId (),
131
+ 'store_id ' => $ customer ->getStoreId ()
132
+ ]
133
+ );
124
134
125
135
if ($ result ) {
126
136
return $ result ;
127
137
}
128
138
129
- $ select = $ this ->connection ->select ()->from ($ this ->getMainTable ())->where ('subscriber_email=:subscriber_email ' );
130
-
131
- $ result = $ this ->connection ->fetchRow ($ select , ['subscriber_email ' => $ customer ->getEmail ()]);
139
+ $ select = $ this ->connection
140
+ ->select ()
141
+ ->from ($ this ->getMainTable ())
142
+ ->where ('subscriber_email=:subscriber_email and store_id=:store_id ' );
143
+
144
+ $ result = $ this ->connection
145
+ ->fetchRow (
146
+ $ select ,
147
+ [
148
+ 'subscriber_email ' => $ customer ->getEmail (),
149
+ 'store_id ' => $ customer ->getStoreId ()
150
+ ]
151
+ );
132
152
133
153
if ($ result ) {
134
154
return $ result ;
You can’t perform that action at this time.
0 commit comments