| CNH | XCG |
|---|---|
| 1 CNH | 0.267086706 XCG |
| 5 CNH | 1.33543353 XCG |
| 10 CNH | 2.67086706 XCG |
| 25 CNH | 6.67716765 XCG |
| 50 CNH | 13.3543353 XCG |
| 100 CNH | 26.7086706 XCG |
| 500 CNH | 133.543353 XCG |
| 1000 CNH | 267.086706 XCG |
| 5000 CNH | 1335.43353 XCG |
| 10000 CNH | 2670.86706 XCG |
| 50000 CNH | 13354.3353 XCG |
| XCG | CNH |
|---|---|
| 1 XCG | 3.744102481 CNH |
| 5 XCG | 18.720512403 CNH |
| 10 XCG | 37.441024807 CNH |
| 25 XCG | 93.602562017 CNH |
| 50 XCG | 187.205124035 CNH |
| 100 XCG | 374.410248069 CNH |
| 500 XCG | 1872.051240346 CNH |
| 1000 XCG | 3744.102480691 CNH |
| 5000 XCG | 18720.512403457 CNH |
| 10000 XCG | 37441.024806913 CNH |
| 50000 XCG | 187205.124034567 CNH |
This set of widgets will provide inline currency conversions to your e-commerce websites for helping your customers around the world to understand your prices in their local currencies, or even in crypto currencies.
Our widgets will work on HTML entities, no Javascript programming is required.
For example, you got an e-commerce website selling T-shirts displaying a list of products like:
which is represented by the HTML code:
<ul>
<li>Red T-shirt CNH 45</li>
<li>Blue T-shirt CNH 123</li>
</ul>
First, we will be including a "script" tag to boot the widgets and we will configure the base currency of our e-commerce website inside of an empty HTML tag like in the next HTML code snippet:
<script src='https://currencyexchange.lucentinian.com/tools.js' async>
</script>
<div
class="lucentinian-currencyexchange-cfg"
data-base="CNH"
data-target="XCG"
data-decimals="2"
></div>
Additionally you can set an initial target currency (later its value will be overrided by the change target currency widget) and fix the number of decimals you want to be displayed like in the previous example.
Please notice the configuration is mandatory, otherwise the widgets won't start.
Now we will be bounding the prices with an HTML entity like "span", assign them the class "lucentinian-currencyexchange", and add the data attribute "data-amount" with the original price in the configured base currency like in the next HTML code nippet:
<ul>
<li>Red T-shirt <span
class='lucentinian-currencyexchange'
data-amount='45'>CNH 45</span>
</li>
<li>Blue T-shirt <span
class='lucentinian-currencyexchange'
data-amount='123'>CNH 123</span>
</li>
</ul>
After the changes, the list is now displayed as:
As it was mentioned above, there is a widget that can be included to allow your customer to change the target currency you may have fix at the beginning and use other by including an empty HTML tag with the class "lucentinian-currencyexchange-cfg" as in the next HTML code snippet:
<div>
Change currency
<span class='lucentinian-currencyexchange-select-currency'>
</span>
</div>
which will be displayed as:
Please notice that the changes of your customer will have priority over the initial target currency configuration, and the changes will be stored in the web browser.
Finally, but not least, prices can be fixed for specific currencies instead of using the converted value. In order to archive this, to the HTML entity that are bounding the price, add the data attribute "data-CURRENCY_CODE-amount" with the fix value. From the example above, a HTML code snippet will look like:
<div>Red T-shirt <span
class='lucentinian-currencyexchange'
data-amount='45'
data-XCG-amount='123'>CNH 45</span>
</div>
which will be displayed with "XCG 123" if the user has selected the currency XCG in the change currency widget of above: