Last updated
Last updated
The accepts an optional configuration object, which allows you to .
If you , you'll need to define .
countrySelector
The countrySelector
object allows you to:
containerId
priceElement
For example, span.price
in the following priceElement
targets all <span>
elements that have a class
attribute of "price"
.
onReady
onOpen
onSelect
onSave
onCancel
The required containerId
represents the id
of an in which should render the .
The optional priceElement
represents an array of strings that uses to target each element on your page that displays pricing information.
When users modify currency or country in the , we make a call to determine whether Digital River supports that country, and it's set up for . If this is the case, for each priceElement
, we apply a conversion factor and a , implement currency formatting rules, and display a converted, formatted value in its innerHTML
and add selected currency, selected country, converted price, formatted price, and original price attributes.
In , you can assign callback methods to , , , , and , which allows you to listen for various events and then define how you want to handle them.
The optional onReady
property can be assigned a callback method that executes when the is ready to accept user input.
When it executes, has been defined. For details, refer to .
The optional onOpen
property can be assigned a callback method that executes when the user clicks on the country-currency icon and the opens.
The optional onSelect
property can be assigned a callback method, which accepts data
, that executes when the user makes a selection in the . In data
, the method returns either country
or currency
, depending on which the user selected.
The optional onSave
property can be assigned a callback method, which accepts data
, that executes when the user clicks the save button. In data
, the method returns the country
and currency
that the user saved.
The optional onCancel
property can be assigned a callback method that executes when the user clicks the cancel button.
Learn about the functionality that exists within the DigitalRiverCheckout configuration object