Support » Plugin: Bitcoin and Altcoin Wallets » Default Coin Selection

  • Hello, i love your plugin, just have a tiny question, i want in certain pages to pre-select certain coins from the lists of the forms you give us, just for user-friendly purpose so they don’t have to select them.
    I know you use knockout.js so is just a script what i need to add to certain pages, but i can’t figure out how, because i dont know the coins ID

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author dashed-slug.net

    (@dashedslug)

    Hello,

    The coin that is selected by default is the one that you select in WalletsFrontend SettingsUI/display settingsDefault coin. This applies throughout your site.

    You can also override this selection in certain pages. In the page editor for any page, scroll to the bottom, and you will find a metabox titled “Bitcoin and Altcoin Wallets default coin”.

    On the frontend, the plugin applies your selection by running the following JavaScript code. I am mentioning this because you may provide additional logic, by binding to the wallets_ready bubbling event in the same way. https://github.com/dashed-slug/wallets/blob/5.0.2/assets/scripts/wallets-ko.js#L1022-L1029 You can get access to the wallets viewModel via wp.wallets.viewModels.wallets from any variable scope.

    Finally, if you were to use the static UIs (rather than dynamic ones), then you can pass the coin as an attribute, and the UI’s HTML will be rendered for that coin only (hence static). Static UIs are discussed in the accompanying documentation. For example: [wallets_balance] would show you a box with a dropdown, where you can select a coin and display its balance, but [wallets_balance template="static" coin="BTC"] would display the current user’s BTC balance only. It’s up to you to see if you find static templates more useful in your case.

    Hope this answers your question.

    with regards

Viewing 1 replies (of 1 total)
  • The topic ‘Default Coin Selection’ is closed to new replies.