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)
3939 */
4040 public function setStore (array |null $ requestData = null ): void
4141 {
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+ }
4349 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 ;
5151 }
52+
5253 $ this ->storeManager ->setCurrentStore ($ storeId );
5354 }
5455}
You can’t perform that action at this time.
0 commit comments