# Add A Few Parameters to Display Currency Switcher

The improved `[yaycurrency-switcher]` shortcode introduces several new parameters that allow users to control the display of different elements of the currency switcher on their website. &#x20;

Previously, when users entered the `[yaycurrency-switcher]` shortcode, they couldn't adjust the elements displayed on the switcher bar. However, after the improvements, users can now customize the display according to their preferences.

With new parameters like <mark style="color:green;">switcher\_size</mark>, <mark style="color:green;">show\_flag</mark>, <mark style="color:green;">show\_name</mark>, <mark style="color:green;">show\_symbol</mark>, <mark style="color:green;">show\_code</mark>, and <mark style="color:green;">device</mark>, users can decide which elements to show or hide, such as the country flag, currency name, currency symbol, and currency code. They can also specify whether the switcher should appear on desktop, mobile, or both.&#x20;

This update provides more flexibility and makes it easier to tailor the display to suit the needs of different websites, improving the overall user experience.

<figure><img src="https://2217518750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_yR1oHovFi42XBPZIi%2Fuploads%2F6P3TDdbMujEgejDhr29N%2Fnewparameters2.png?alt=media&#x26;token=3b8b811e-feb9-4cc3-aa94-878d9253520d" alt=""><figcaption></figcaption></figure>

### Step 1: Understanding the New Parameters

The improved \[yaycurrency-switcher] shortcode introduces several new parameters that offer more granular control over the display of different elements on the currency switcher.

<mark style="color:green;">**switcher\_size**</mark>: Defines the size of the currency switcher.

* small
* medium
* large

<mark style="color:green;">**show\_flag**</mark>: Controls whether the country flag of the currency is displayed.

* yes to show the flag, no to hide it.

<mark style="color:green;">**show\_name**</mark>: Determines whether the full name of the currency is shown.

* yes to display the currency name, no to hide it.

<mark style="color:green;">**show\_symbol**</mark>: Specifies whether the currency symbol (like $, €, £) is shown.

* yes to display the symbol, no to hide it.

<mark style="color:green;">**show\_code**</mark>: Indicates whether the currency code (e.g., USD, EUR) is shown.

* yes to show the code, no to hide it.

<mark style="color:green;">**device**</mark>: Allows users to define on which devices the switcher will be displayed.

* desktop to show on desktop only,
* mobile to show on mobile devices only,
* all to show on both desktop and mobile.

*For example:*&#x20;

If you only want to display the country flag and currency symbol for all devices with a medium switcher size, you can use the following shortcode configuration:

`[yaycurrency-switcher switcher_size="medium" show_flag="yes" show_name="no" show_symbol="yes" show_code="no" device="all"]`

### Step 2: Customizing the Switcher Appearance

<figure><img src="https://2217518750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_yR1oHovFi42XBPZIi%2Fuploads%2Fsk40WxV1wUc5u9gnn0JB%2Fnewparameters3.png?alt=media&#x26;token=c231522c-6936-4487-b1a5-265291b8b9ec" alt=""><figcaption></figcaption></figure>

This setup ensures that only the country flag and currency symbol are visible across all devices.

The `[yaycurrency-switcher]` shortcode provides flexibility in displaying currency information on your website. By using parameters, you can control which elements are shown and on which devices. This makes it easy to offer an optimized and user-friendly currency switcher for different platforms.

### Step 3: Check the Front-end

<figure><img src="https://2217518750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_yR1oHovFi42XBPZIi%2Fuploads%2F9ZXQCW0PkLDxoa6dMMrx%2Fnewparameters1.png?alt=media&#x26;token=0ccad222-7eb8-4ff4-aa76-3b301ff37c68" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}

* **For Desktop only**: `[yaycurrency-switcher switcher_size="medium" show_flag="yes" show_name="yes" show_symbol="yes" show_code="yes" device="desktop"]`&#x20;
* **For Mobile only**: `[yaycurrency-switcher switcher_size="small" show_flag="yes" show_name="no" show_symbol="no" show_code="yes" device="mobile"]`
* **For Desktop & Mobile**: `[yaycurrency-switcher switcher_size="medium" show_flag="yes" show_name="yes" show_symbol="yes" show_code="yes" device="all"]`&#x20;
  {% endhint %}
