Title: Default Transaction
Last modified: March 31, 2020

---

# Default Transaction

 *  [daviidleon](https://wordpress.org/support/users/daviidleon/)
 * (@daviidleon)
 * [6 years ago](https://wordpress.org/support/topic/default-transaction/)
 * Hello, im using this amazing plugin, but i need to use it so the members of the
   platform can send to the page admin some transactions, and in order to do that
   i took the TRANSFER TO USER WALLET WIDGET and i need to modify it, so that when
   it pops up it already has selected the admin user for the transfer and the clients
   don’t get confused
 *     ```
       	<td colspan="3">
       					<label class="user"><?php echo apply_filters( 'wallets_ui_text_recipientuser', esc_html__( 'Recipient user', 'wallets-front' ) ); ?>: 
       					<input id="userInput" list="<?php echo esc_attr( $uid = uniqid( 'wallets-move-' ) ); ?>" type="text"  required="required" placeholder="<?php echo apply_filters( 'wallets_ui_text_enterusernameoremail', esc_html__( 'dmalab.co', 'wallets-front' ) ); ?>"
       					data-bind="value: moveUser, valueUpdate: ['afterkeydown', 'input']" onclick="myFunction"  /></label>
       					<datalist id="<?php echo esc_attr( $uid ); ?>">
       						<?php foreach ( Dashed_Slug_Wallets::get_move_recipient_suggestions() as $user_name ): ?>
       						<option value="<?php echo esc_attr( $user_name ); ?>">
       						<?php endforeach; ?>
       					</datalist>
       				</td>
       ```
   
 * That is the part of the form that i need to modify, simply put in the input ‘
   admin’ and make it work, but of course that data-binding doesn’t let me just 
   add value=”” or something and i’m stuck because i checked in wallets-ko.js and
   tried to adjust it there and it simply doesn’t work, i really need help 🙁 Sorry
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdefault-transaction%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [dashed-slug.net](https://wordpress.org/support/users/dashedslug/)
 * (@dashedslug)
 * [6 years ago](https://wordpress.org/support/topic/default-transaction/#post-12610374)
 * Hello,
 * First of all, to see why you should’t be editing the plugin’s code, please read
   the [FAQ](https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin/faq/)
   under “I want to do changes to the plugin’s code.”
 * I will give first a long explanation on how to approach this, and then also a
   complete solution.
 * You cannot set the value attribute directly, because the form’s input fields 
   are bound to [knockout.js](http://knockoutjs.com/) “observables”. “Observables”
   are simply variables that are part of the [viewmodel](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel).
 * This particular observable is `moveUser` and is found here: [https://github.com/dashed-slug/wallets/blob/4.4.8/assets/scripts/wallets-ko.js#L353](https://github.com/dashed-slug/wallets/blob/4.4.8/assets/scripts/wallets-ko.js#L353)
 * You can set the observable like so: `wp.wallets.viewModels.wallets.moveUser('
   admin');`.
 * To do this, you would first need to wait for the wallet’s front-end to load. 
   When the front-end loads, it fires a `wallets_ready` [bubbling event](https://javascript.info/bubbling-and-capturing)
   that you can catch at the root of the DOM, like so:
 *     ```
       jQuery( 'html' ).on( 'wallets_ready', function( event, coins, nonces ) {
       	wp.wallets.viewModels.wallets.moveUser('admin');
       }
       ```
   
 * The trick is to add this in your [child theme](https://developer.wordpress.org/themes/advanced-topics/child-themes/),
   so that even if all the plugins and your theme get updated, your code doesn’t
   get wiped out. One quick way to do this is to add the following to your child
   theme’s `functions.php` file:
 *     ```
       function set_move_recipient() {
       	?>
       	<script>
       		jQuery( function() {
       			jQuery( 'html' ).on( 'wallets_ready', function( event, coins, nonces ) {
       				wp.wallets.viewModels.wallets.moveUser('admin');
       			} );
       		} );
       	</script>
       	<?php
       }
       add_action( 'wp_head', 'set_move_recipient' );
       ```
   
 * Hopefully your theme knows about the [`wp_head`](https://developer.wordpress.org/reference/functions/wp_head/)
   action, as some low-quality themes don’t use it. If that’s the case, add the 
   JavaScript code into your site some other way.
 * Hope this helps. Let me know if you need any help implementing this into your
   theme.
 * with regards,
    Alex

Viewing 1 replies (of 1 total)

The topic ‘Default Transaction’ is closed to new replies.

 * ![](https://ps.w.org/wallets/assets/icon-256x256.png?rev=1570088)
 * [Bitcoin and Altcoin Wallets](https://wordpress.org/plugins/wallets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wallets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wallets/)
 * [Active Topics](https://wordpress.org/support/plugin/wallets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wallets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wallets/reviews/)

## Tags

 * [frontend](https://wordpress.org/support/topic-tag/frontend/)
 * [move](https://wordpress.org/support/topic-tag/move/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 1 reply
 * 2 participants
 * Last reply from: [dashed-slug.net](https://wordpress.org/support/users/dashedslug/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/default-transaction/#post-12610374)
 * Status: not resolved