malsubrata / woo-wallet

WooCommerce Wallet
GNU General Public License v3.0
78 stars 37 forks source link

Fix - PHP Compat issue #82

Closed shivapoudel closed 9 months ago

shivapoudel commented 10 months ago

image

shivapoudel commented 9 months ago

@malsubrata We have implemented this snippet for our child theme for a temporary fix, but if this gets merged in TeraWallet, it will be sweet.

/**
 * TeraWallet - Float as wallet balance.
 *
 * @since 1.0.0
 *
 * @todo Remove after the deployment to the TeraWallet plugin.
 * @see https://github.com/malsubrata/woo-wallet/pull/82
 * 
 * @param int $wallet_balance Wallet balance.
 *
 * @return float The updated wallet balance.
 */
function besa_child_woo_wallet_current_balance( $wallet_balance ) {
    return (float) $wallet_balance;
}
add_filter( 'woo_wallet_current_balance', 'besa_child_woo_wallet_current_balance' );
shivapoudel commented 9 months ago

Patched in the latest version 1.4.11 and the reference links to https://github.com/malsubrata/woo-wallet/commit/e780cbdd911e39b2d077685dcd217dea6b0ac1c5