File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
app/code/Magento/Customer/Model Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,17 @@ public function __construct(private StoreManagerInterface $storeManager)
39
39
*/
40
40
public function setStore (array |null $ requestData = null ): void
41
41
{
42
- $ storeId = $ requestData [CustomerInterface::STORE_ID ] ?? null ;
42
+ $ websiteId = $ requestData [CustomerInterface::WEBSITE_ID ] ?? null ;
43
+ try {
44
+ $ website = $ this ->storeManager ->getWebsite ($ websiteId );
45
+ $ storeId = $ website ? current ($ website ->getStoreIds ()) : null ;
46
+ } catch (LocalizedException $ e ) {
47
+ $ storeId = null ;
48
+ }
43
49
if (!$ storeId ) {
44
- $ websiteId = $ requestData [CustomerInterface::WEBSITE_ID ] ?? null ;
45
- try {
46
- $ website = $ this ->storeManager ->getWebsite ($ websiteId );
47
- $ storeId = $ website ? current ($ website ->getStoreIds ()) : null ;
48
- } catch (LocalizedException $ e ) {
49
- $ storeId = null ;
50
- }
50
+ $ storeId = $ requestData [CustomerInterface::STORE_ID ] ?? null ;
51
51
}
52
+
52
53
$ this ->storeManager ->setCurrentStore ($ storeId );
53
54
}
54
55
}
You can’t perform that action at this time.
0 commit comments