Examples

Familiarize yourself with the use of JS SDK events and methods.

Create additional switcher

        
            
        
    
        
            
        
    
        
            
        
    

Switch to another language

Using inline javascript code

        
            
        
    

or using event listener

        
            
        
    
        
var links = document.querySelectorAll(".language-link");

for(var i = 0, count = links.length; i < count; i++) {

    links[i].addEventListener("click", function(e) {
        var code = e.currentTarget.dataset.code;
        LangShopSDK.switchLanguage(code);
    });
}
        
    
        
            
        
    

Switch to another currency

        
            
        
    
        
var selector = document.getElementById("simple-selector");

selector.addEventListener("change", function(e) {
    var code = e.currentTarget.value;
    LangShopSDK.switchCurrency(code);
});
        
    

React on the opened dropdown switcher

        
            
        
    

Take action only if certain language is chosen

        
            
        
    

Format product price

        
            
        
    

Show price in your own format

        
            
        
    

Save user last language before language switched

        
            
        
    

Track switching the currency with Google Analytics

        
            
        
    

Start your 3-day free trial today!

Try LangShop free for 3 days by entering your domain of Shopify store.