Hi, I have a problem with getting the multistate box to work inside of a lightbox for a multilingual site. It is a very important flow for me, as I’m showing customers a signup form in their own language which enrolls them in a language-specific flow of emails.
Here is the code that I’m using for a multistate box that IS NOT in a lightbox and that works great! (This is in my masterPage.js file, as I’m using this multistate box in my footer).
import wixWindow from ‘wix-window’ ;
const current_language = [ ‘et’ ];
$w.onReady( function () {
let lang = wixWindow.multilingual.currentLanguage;
//based on current_language
/////////////////////////////////////
if (current_language.includes(lang)){
$w( ‘#statebox8’ ).changeState( ‘estonian’ );
}
else {
$w( ‘#statebox8’ ).changeState( ‘english’ );
}
});
Here is the code for a multistate box that IS inside of a lightbox and the odd thing is that it works in Preview, but not in production! (This code is only in the Lightbox file, as the multistate box is only in the Lightbox).
import wixWindow from ‘wix-window’ ;
const current_language = [ ‘et’ ];
$w.onReady( function () {
let lang = wixWindow.multilingual.currentLanguage;
//based on current_language
/////////////////////////////////////
if (current_language.includes(lang)){
$w( ‘#statebox9’ ).changeState( ‘estonian2’ );
}
else {
$w( ‘#statebox9’ ).changeState( ‘english2’ );
}
});
Any help would be much appreciated!