• Resolved creativefriends

    (@creativefriends)


    Thanks for the awesome plugin!!

    How can I make the Pay with wallet checked default in the Checkout page? if the customer decides not to pay with a wallet they can uncheck it.

    Note: I’m using the wallet for partial payment only (ex. only 10% of the cart value is paid using terawallet, remaining will be paid by another gateway ).

Viewing 1 replies (of 1 total)
  • Plugin Contributor Moumita Adak

    (@moumitaadak)

    Hi @creativefriends
    Sorry for the delayed response.
    Please paste the below code in “your active theme”/functions.php file

    if (!function_exists('enable_wallet_partial_payment')) {
        function enable_wallet_partial_payment() {
            ?>
            <script type="text/javascript">
                jQuery(function ($) {
                    var is_reloaded = false;
                    $(document.body).on('update_checkout', function (event) {
                        if (!is_reloaded) {
                            event.stopImmediatePropagation();
                            var data = {
                                action: 'woo_wallet_partial_payment_update_session',
                                checked: true
                            };
                            $.post('<?php echo admin_url('admin-ajax.php'); ?>', data, function () {
                                $(document.body).trigger('update_checkout');
                            });
                            is_reloaded = true;
                        }
                    });
                });
            </script>
            <?php
        }
    }
    
    add_action('wp_footer', 'enable_wallet_partial_payment');

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Making Pay with wallet checked default in the Checkout page’ is closed to new replies.