ShortCodes Examples

On this page

Automatically generated switchers shortcodes

To include languages or currencies switchers via shortcodes, you can use automatically generated shortcodes on the switcher page. E.g. follow next steps to find language switcher shortcode:

  1. Go to "Settings" -> "Languages" -> "Switchers" page of the LangShop application.
  2. Select needed switcher or create new.
  3. Copy automatically generated switcher shortcode.
    Language switcher shortcode
  4. Use copied shortcode in any place of your store's content.

You can use [LS_LANGUAGE_TITLE] or [LS_CURRENCY_TITLE] shortcodes to create simple list with links. [LS_LANGUAGE_HREF] and [LS_CURRENCY_HREF] shortcodes allow you to use language/currency switching on the click action. See the usage examples below.

Input

<ul>
    <li>
        <a href="[LS_LANGUAGE_HREF en]">
            [LS_LANGUAGE_TITLE en]
        </a>
    </li>
    <li>
        <a href="[LS_LANGUAGE_HREF fr]">
            [LS_LANGUAGE_TITLE fr]
        </a>
    </li>
    <li>
        <a href="[LS_LANGUAGE_HREF ar]">
            [LS_LANGUAGE_TITLE ar]
        </a>
    </li>
</ul>

Output

<ul>
    <li>
        <a href="javascript:LangShopSDK.switchLanguage('en');">
            English
        </a>
    </li>
    <li>
        <a href="javascript:LangShopSDK.switchLanguage('fr');">
            French
        </a>
    </li>
    <li>
        <a href="javascript:LangShopSDK.switchLanguage('ar');">
            Arabic
        </a>
    </li>
</ul>

Create languages links in Shopify navigation

Use [LS_LANGUAGE_TITLE] shortcode with languages codes to create simple navigation menu.

  1. Go to "Online Store" -> "Navigation" page of the Shopify store admin.
  2. Choose needed navigation list or create new.
  3. Click "Add menu item" or modify existing:

    • Use [LS_LANGUAGE_TITLE ar] shortcode in the "Name" field to display language title by ar code.
    • Use #locale=ar hash in the "Link" field to switch language after click action.
    Language title shortcode in navigation item
  4. You can add all published languages to your navigation menu.
    Language links in navigation menu

Insert shortcode to theme customizer

  1. Go to "Online Store" -> "Themes" page of the LangShop application.
  2. Click "Customize" for needed LangShop theme.
  3. Insert shortcode to any text fields you needed to display shortcode output in.

Report incorrect information

Still Have Questions?

Our customer care team is here for you!

Contact Us