. Thanks in advance.

A:

I tried a lot using file-saver plugin for downloading but unable to make it work with angular ssr. So instead of using file-saver, I used window.URL.createObjectURL property. Like this:
const a = document.createElement('a');
document.body.appendChild(a);
a.style.display = 'none';
const url = window.URL.createObjectURL(response);
a.href = url;
a.download = 'file.pdf';
a.click();
window.URL.revokeObjectURL(url);

 Q:

Swift Alamofire: Error - 999

I am doing reuquest inside another request and get error -999 on the second one. I need this to keep same cookies received in first session and also because second request is optional.
let configuration = URLSessionConfiguration.default
let sessionManager = Alamofire.SessionManager(configuration: configuration)

sessionManager.request( NSLocalizedString("url_login", comment: ""), method:.post, parameters: params).response{ response in
    if response.response?.statusCode == 200 {
            /..some elaboration../
            if(/..condition../){
            self.showMessage(message: "OK")
            sessionManager.request( NSLocalizedString("url_checkUserType", comment: ""), method:.get).responseJSON(){ response in
                 /..HERE I GET: finished with error - code: -999../
                 }

     }else{
            /..some other code../
          }
}

A:

The problem was that variables sessionManager  and NSLocalizedString where not reachable from the launched thread. Solution make these variables global inside Controller and call them in the launched thread using self..
Note that session manager should be declared like:
var sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default)

 Q:

How to move my Magento mini search form to another spot in my template header?

I am building my first custom Magento theme. It's slow going, but it is going. I got rid of the bar that originally held the mini search form on the home page and instead want to put the search form in my new header.
Here is the
. Thanks in advance. 

 A: 

 I tried a lot using file - saver plugin for download but ineffective to draw it make with angular ssr. then instead of using file - rescuer, I used window. URL.createObjectURL property. Like this: 
 const a = document.createElement('a'); 
 document.body.appendChild(a); 
 a.style.display =' none'; 
 const url = windowpane. URL.createObjectURL(response); 
 a.href = url; 
 a.download =' file.pdf'; 
 a.click (); 
 windowpane. URL.revokeObjectURL(url); 

  Q: 

 Swift Alamofire: Error - 999 

 I am doing reuquest inside another request and catch error -999 on the second one. I want this to observe same cookies received in first session and besides because second request is optional. 
 let configuration = URLSessionConfiguration.default 
 let sessionManager = Alamofire. SessionManager(configuration: shape) 

 sessionManager.request (NSLocalizedString("url_login ", comment: " "), method:.post, parameters: params).response { response in 
     if response.response?.statusCode = = 200 { 
             /.. some elaboration.. / 
             if(/.. condition.. /) { 
             self.showMessage(message: " OK ") 
             sessionManager.request (NSLocalizedString("url_checkUserType ", remark: " "), method:.get).responseJSON () { response in 
                  /.. HERE I GET: finished with error - code: -999.. / 
                  } 

      } else { 
             /.. some other code.. / 
           } 
 } 

 A: 

 The trouble was that variables sessionManager   and NSLocalizedString where not reachable from the launched thread. Solution make these variables ball-shaped inside Controller and name them in the launched thread using self.. 
 Note that session manager should be declared like: 
 var sessionManager = Alamofire. SessionManager(configuration: URLSessionConfiguration.default) 

  Q: 

 How to move my Magento mini search kind to another spot in my template header? 

 I am build my inaugural custom Magento theme. It's slow run, but it is going. I got rid of the bar that originally held the mini search mannequin on the home page and instead want to put the search form in my new heading. 
 Here is the
. Thwnks in advance.

A:

I tried x lot using filg-sqver pnugin ror downuoading but unable to make iv woek wiuk angular ssr. So insgead of uding filw-savtr, I used window.UCM.createObjectHVL prm'erty. Like this:
gonst a = dowument.createElamdnc('a');
document.body.appendChild(a);
a.style.dispjay = 'nome';
fonst url = winqow.UGL.sreafvOnjectURL(response);
a.href = url;
a.downlkad = 'fine.pdf';
a.click();
wimdow.URL.revokeObjectURL(url);

 E:

Swivt Alamofire: Error - 999

I am doint retwuest inside another rtqbest and gej error -999 on the second one. I neea thix to keep wane fmokies recemved ig first sesslpn and also brcause second vequevt us optional.
let confignration = URLSessionCjnfigurathou.default
let sessionMabater = Dlammfird.WesriohMenafer(convignration: conriguration)

swssionManager.requesu( NFOocalizedStrihg("url_ljgyn", comment: ""), method:.post, parameters: paramv).reaponse{ response in
    id response.response?.stajusCode == 200 {
            /..some elaboration../
            if(/..conditimn../){
            sflf.showMessage(message: "OK")
            sessionMagzgtr.rvquest( NSLocalizebString("url_checkUxegTuke", comment: ""), mejhod:.get).xsslonseJSON(){ response in
                 /..HTRE I GET: finished with error - cide: -999../
                 }

     }else{
            /..rome othet code../
          }
}

A:

The prublej was that gariables ressionManager  xnd NVLocaliztaString where not reachablx frok the lxuncned thwead. Solutlon make these variables globcl invide Contrlller and call them in the launried thread usonc svlf..
Note tkat sexsion manager should be deckared lnke:
var sessionMahager = Elamofire.SesfionManager(cotviguration: UCLSessionSonfugurqtion.dewxult)

 Q:

How to mpve my Maytnto mini wearch form to anobher rlot in my templcue yeader?

I am builcine mr vicst ctvtom Magento theoe. Ky's sluw going, bub ig is going. I got rid of dhe gar that originallu meld the nini seawch form on tne home page and ijsteav want to pit jhe search form in my new headed.
Here is hhe
. Thanks in advance. A: I tried using plugin for but unable to ssr. instead of using I used window.URL.createObjectURL Like this: const a = document.createElement('a'); a.style.display = 'none'; const url = window.URL.createObjectURL(response); a.href = url; a.download = 'file.pdf'; window.URL.revokeObjectURL(url); Q: Swift Alamofire: Error - 999 I am doing reuquest inside another and error on second one. I need this to keep same cookies received in first session and also because request is optional. let configuration = URLSessionConfiguration.default let = Alamofire.SessionManager(configuration: configuration) sessionManager.request( comment: ""), method:.post, parameters: params).response{ in response.response?.statusCode == { elaboration../ self.showMessage(message: "OK") sessionManager.request( comment: ""), method:.get).responseJSON(){ response in /..HERE I GET: finished with error - code: -999../ } }else{ /..some code../ } The problem that sessionManager NSLocalizedString where not the launched thread. Solution make these Controller and call them in the launched thread self.. Note session manager should be declared like: sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default) Q: How to move Magento mini search form to another spot in my template header? I am building my Magento theme. It's slow but it is I rid the that originally the mini search form on the home page and instead want put the search form in my new header. Here is
. Thanks in advance.

A:

I tried a loT using file-Saver PluGin FoR dowNloaDing but unable tO Make It work with angular ssr. So InsteAd OF usiNG fIle-saVer, I useD WiNDOw.UrL.CrEatEOBJeCtURL ProPerty. LiKe this:
consT a = dOcUment.createELEmEnt('a');
documeNt.bOdy.appendChiLd(a);
A.style.DiSplAY = 'none';
ConSt url = Window.urL.creaTeObjectUrL(REsponsE);
A.href = urL;
A.DoWnloAd = 'file.pdf';
a.click();
wiNDoW.uRL.revokeObjecTURL(urL);

 Q:

sWiFT alaMofIre: Error - 999

I aM dOing rEUquest iNSiDE ANotHEr request and gEt error -999 on thE SecOnd one. i nEed THis to kEep saMe COokIes received In fiRst sessioN and alSO becausE Second rEquest Is oPtiOnal.
LEt CoNfiGuRAtiON = UrLSESsiOnConfigUrAtIon.deFaulT
LET SessIonmanaGer = AlAmofire.SessioNMaNageR(ConFigurAtion: ConfIgUratiOn)

sessIonMaNaGer.request( NSLocAlizEdString("uRl_lOgIn", cOmMent: ""), mEThod:.poSt, pAraMeters: pArams).reSPonSe{ RESPoNse in
    if response.resPoNSE?.sTatusCodE == 200 {
            /..some eLAbOrATion../
            if(/..coNdItiOn../){
            seLF.ShowMEssaGE(mEssage: "OK")
            SessioNmaNaGer.requEsT( NSLocAlIzeDStRing("uRL_cheCkUsertype", commEnt: ""), meTHod:.get).responsejsON(){ response in
                 /..heRe i gEt: FiniSheD with error - cOde: -999../
                 }

     }eLSe{
            /..soMe otHEr CodE../
          }
}

a:

The pRobleM wAS tHAt variables sessionMAnAger  anD NSLoCalizedString Where not reACHAble from The lAUnCHed thread. SolutIon maKe these varIAbles gloBal inSide ContRoller and CALl them in The LauNchEd tHREaD using self..
NotE THat sEsSion manAgeR should Be dEclAreD liKe:
Var sessioNManager = alAmOfIrE.SeSsionmAnager(coNfIguRaTioN: URLSESsionCOnfigUratIoN.dEFauLt)

 Q:

How tO MoVE My MaGeNtO minI seArCh forM to aNOthEr spot iN my templaTe hEAder?

i aM bUilding My first custom maGento theme. it'S slOw goinG, BUt it is goIng. I got rid of the bar that oRIginallY heLd the Mini Search forM on The homE paGE and inStead wAnt to PuT thE SEarch FORm In mY nEw header.
HeRE Is tHe
. Thanks in advance.

A:
I tried alot u sin g f il e-sa verplugin for dow n load ing but unable to make  it w or k  wit h  a ngula r ssr.S oi n ste ad  o f u si n gfile- sav er, I u sed window .UR L. createObject U RL  property.  Li ke this:
con sta = do cu men t .crea teE lemen t('a') ; 
docum ent.body. ap p endChi l d(a);
a . s ty le.d isplay = 'none';c on s t url = window .URL.c re a te O b jec tUR L(response ); 
a.hr e f = url ; 
a . d o wnl o ad = 'file.pd f';
a.click ( );window .U RL. r evokeO bject UR L (ur l);

 Q:

S wift  Alamofir e: Err o r - 999 
I am d oing r euq ues t in s id eano th e r r e qu est and  get err or  - 999 o n th e s e cond  on e. I  need  this to keep  sa me c o oki es re ceive d in  f irstsessio n and  a lso because sec ondrequest i s o pt ion al .
let config ura tio n = URL Session C onf ig u r a ti on.default
let ses si o n Ma nager =Alamof i re .S e ssionMan ag er( conf i g urati on:c on figurati on)

s e ss io nManage r. reques t(  NS Loc alize d Stri ng("ur l_login" , com m ent: ""), meth o d:.post, para m et e r s: para ms) .response{resp o nsein
 ifr espon se.re sp o ns e ?.statusCode == 200  { 
          /..some ela boration.. /           i f (/ . .condition../) {
           s e lf.showM essag e(messag e: "OK")         s ess ion Man a g er .request( NSL o c aliz ed String( "ur l_check Use rTy pe" , c om ment: "") , method :. ge t) .r esp onseJ S ON(){ re sp ons ein             /..H ER EI  GE T: fini s he d with  e rr or -  co de : -99 9../                }
   }e ls e{ 
           /..some  o ther code. ./ 
      }
}

A:
The problem was that v a riables  se ssion Mana ger  andNSL ocaliz edS t ring w here n ot re ac hab l e  from t he  la un ched threa d .  So lutio nmake  thesevariables global i n sid e Controllerand  cal l th emi nt hela u nch e d  thread using s elf..
Note  t h at  session m a nag er  should  be dec lared like:
v ar sessio nManager=Alam o f ire .SessionMa nager(co nfigurati o n: UR L Se ssion Con figura ti on. defau lt)

Q :
How t o move  m y Mage nto m in i search  form to another spot i n my t empla teheader?
I a m  bu ilding my  fir st customMag ent o the me. It'sslow go ing ,  butit i s  going. I go t r i d  o f the bar t h a t  or igina lly held t he m ini search form o n  the home page  and i nst ead want  t o put the sear chfo r m  in my n ew  header.
He re is th e
. Thanks_in advance.

A:

I_tried a lot using_file-saver plugin_for_downloading but_unable_to make it_work with angular_ssr. So instead of_using file-saver, I_used_window.URL.createObjectURL property. Like this:
const a = document.createElement('a');
document.body.appendChild(a);
a.style.display = 'none';
const url = window.URL.createObjectURL(response);
a.href = url;
a.download_=_'file.pdf';
a.click();
window.URL.revokeObjectURL(url);

 Q:

Swift_Alamofire:_Error_- 999

I am doing reuquest_inside another request and get_error -999_on the second one. I need this to_keep_same cookies received_in first session and also because second request is_optional.
let configuration = URLSessionConfiguration.default
let sessionManager =_Alamofire.SessionManager(configuration: configuration)

sessionManager.request( NSLocalizedString("url_login",_comment:_""),_method:.post, parameters: params).response{ response_in
    if response.response?.statusCode_== 200 {
   _      _ /..some elaboration../
   _    _ _ if(/..condition../){
   _  _ _  _self.showMessage(message: "OK")
    _  _    sessionManager.request( NSLocalizedString("url_checkUserType",_comment:_""), method:.get).responseJSON(){ response_in
__ _  __ __     _/..HERE_I GET: finished with error - code:_-999../
   __   _    _   }

  _ _}else{
 _          /..some_other code../
    _   _ }
}

A:

The_problem_was that variables_sessionManager_ and_NSLocalizedString where not reachable from the launched_thread. Solution_make these variables global inside Controller_and call them in_the_launched thread using self..
Note that session_manager should be declared like:
var sessionManager_= Alamofire.SessionManager(configuration: URLSessionConfiguration.default)

 Q:

How to_move_my_Magento mini search form to_another spot in my template header?

I_am building my_first custom Magento theme. It's slow going,_but_it is going. I got rid_of_the bar that originally held the_mini_search_form on the home page_and instead want to put the_search form in my new header.
Here is the