Setting up the widget
This is a guide on setting up the widget.
Introduction
This widget has two components:
- Widget Component: It shows the plans that are currently being featured.
- Popup Component: It pops up when a plan is clicked. It shows the plan details and an order can be places from within the component.
Installation
The installation is fairly simple as setting a script tag.
<script src="https://www.japan-wireless.com/esim/widget/v1/dist/index.js"></script>
Usage
The widget is attached to a div component that is passed when initiailizing it. The div component should be at least 250px or it might not show the full widget.
<div id="widget-container"></div>
<script src="https://www.japan-wireless.com/esim/widget/v1/dist/index.js"></script>
<script>
const widget = new JapanWirelessWidget({
container: "#widget-container",
});
widget.initialize();
widget.show();
</script>
Custom plans
The widget can be setup to use show custom plans by passing an array of plan ID's.
<div id="widget-container"></div>
<script src="https://www.japan-wireless.com/esim/widget/v1/dist/index.js"></script>
<script>
const widget = new JapanWirelessWidget({
container: "#widget-container",
plans: [11, 21, 39, 42, 15]
});
widget.initialize();
widget.show();
</script>
Internationalization
The widget can be dislayed in several different languages. You can pass a language option when initiailizing the widget. The language codes are:
- "de": German
- "en": English
- "es": Spanish
- "fr": French
- "it": Italian
- "jp": Japanese
- "kr": Korean
- "ms": Malay
- "tl": Tagalog (Filipino)
- "vi": Vietnamese
- "zh": Chinese (Simplified)
- "zt": Chinese (Traditional)
<div id="widget-container"></div>
<script src="https://www.japan-wireless.com/esim/widget/v1/dist/index.js"></script>
<script>
const widget = new JapanWirelessWidget({
container: "#widget-container",
language: "jp"
});
widget.initialize();
widget.show();
</script>
Currency
The prices of the plans in the widget can be dislayed in several different currencies. You can pass a currency param in the params
option when initiailizing the widget. The currencies are:
- "PHP": Philippine Peso
- "JPY": Japanese Yen
- "USD": US Dollar
- "EUR": Euro
- "AUD": Australian Dollar
- "CAD": Canadian Dollar
- "TWD": New Taiwan Dollar
- "HKD": Hong Kong Dollar
- "CNY": Chinese Yuan
- "GBP": British Pound Sterling
- "KRW": South Korean Won
<div id="widget-container"></div>
<script src="https://www.japan-wireless.com/esim/widget/v1/dist/index.js"></script>
<script>
const widget = new JapanWirelessWidget({
container: "#widget-container",
params: {
currency: "EUR",
},
});
widget.initialize();
widget.show();
</script>
Using coupons and referral
Coupons and referral paramters for the widgets can be set using a params option.
<script>
const widget = new JapanWirelessWidget({
container: "#widget-container",
params: {
via: "affilate",
coupon: "Lo88GH97",
},
});
widget.initialize();
widget.show();
</script>
Customization
Customizing the Widget Component
For customizing the Widget Component, it's fairly simple. The container element can be styled for that purpose.