I have been chasing my tail all day. We have an e...
# suitecommerce
g
I have been chasing my tail all day. We have an external system that programmatically will log a user into SuiteCommerce Advanced calling the ModelsInit.session.login function, then redirecting the user after the fact. This works and the user will get to tehshopping section just fine. However when leaving the shopping section to go to the My account section the site bombs in the MyAccountEnvironment.ServiceController as it to access variables on the Environment as it says it is undefined. Specifically the below code when it tries to access currentCurrency. The weird part is it looks like the ShoppingEnvironment call does the same thing and it works fine, all variables are there. Does anyone have any ideas on what could bethe culprit here?
Copy code
Environment = Application.getEnvironment(this.request);
.....
  myAccountEnv.SESSION = {
                currency: Environment.currentCurrency,
                language: Environment.currentLanguage,
                priceLevel: Environment.currentPriceLevel,
                touchpoints: SiteSettings.touchpoints
            };
s
Is it a race condition? You're calling it before it has been set?
g
I would expect it to not be because the site loads into the shopping section where SC.ENVIRONMENT is fully populated, including the currentCurrency/language. It is only when i cross into my account that it is then not populated. I am going totest a efw other ideas I came up with over night and see if they yield any results.
AHA. It looks like the contacts set up to allow this system were given a different role which gave them fewer permissions than they need.
s
Interesting!