dashed-slug.net › Forums › CoinPayments.net Wallet Adapter extension support › How can I set default withdrawal address
Tagged: frontend, knockout, move, plugin overrides, templates, UI, views, wallets, wallets_views_dir, withdrawal
- This topic has 5 replies, 3 voices, and was last updated 6 years, 2 months ago by
alexg.
-
AuthorPosts
-
August 29, 2018 at 8:52 am #4206
alexg
KeymasterHello,
You can already control whether withdrawals are enabled or disabled for a group of users (Role), using the capabilities menu.
As for your other requirement, there is no need to use a blockchain address. Simply do an internal transfer (move). You could override the
[wallets_move]
UI to provide a UI that always sends to the admin account, using a hidden input field rather than a visible user field. Please see the documentation on how to override the knockout UIs. If you create your view inwp-content/plugins/wallets/includes/views/move/toadmin.php
, then you can use a shortcode such as[wallets_move template="toadmin"]
.kind regards
April 14, 2019 at 2:18 am #6179Anonymous
Inactivebeen trying to do a hidden field but i keep getting this error
“Wallet operation failed: Could not move : Required parameter missing: move_toaccount”
so i tried several variations of a hidden field
<input type="hidden" name="__wallets_move_tags" value="move" /> <input type="hidden" name="user" value="Central Bank" />
and
<input type="hidden" name="__wallets_move_tags" value="move" /> <input type="hidden" name="moveUser" value="Central Bank" />
but nothing is working, keep getting same error
what am i doing wrong?
April 15, 2019 at 5:07 am #6188alexg
KeymasterKnockout does not bind observables to hidden values, even if you try. However from your code it doesn’t look like you’ve even tried to add any bindings.
Instead, follow the instructions I gave earlier. There is no reason for you to use knockout for this, as you have nothing that needs synchronizing. Some plain old jQuery or even vanilla JavaScript will do the trick.
with regards
April 15, 2019 at 6:03 pm #6192Anonymous
Inactivei was following what you said in that link you left 🙁
and as far as bindings, or wht i left out that is why i asked. I have never came across or used knockout until trying to edit this plugin, its not easy for a novice to work with at all
April 15, 2019 at 6:10 pm #6193alexg
KeymasterMy apologies, I thought you were trying to use knockout because I saw some input field names that match the observables. My mistake.
The next step would be to use JavaScript to call the JSON API when the form is submitted. That’s it!
-
AuthorPosts
- You must be logged in to reply to this topic.