This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!function_exists('points_to_wallet_balance_convertion_shortcode_func')) { | |
function points_to_wallet_balance_convertion_shortcode_func($atts) { | |
$atts = shortcode_atts( | |
array( | |
'convertion_rate' => 1 | |
), $atts, 'convert_points_to_wallet_balance' ); | |
if(!is_user_logged_in()){ | |
return __('Please login'); | |
} | |
$user = wp_get_current_user(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('is_enable_wallet_partial_payment', '__return_true'); | |
add_filter('is_valid_payment_through_wallet', '__return_false'); | |
add_filter('woo_wallet_partial_payment_amount', 'woo_wallet_partial_payment_amount_callback', 10); | |
function woo_wallet_partial_payment_amount_callback($amount) { | |
if (sizeof(wc()->cart->get_cart()) > 0) { | |
$cart_total = get_woowallet_cart_total(); | |
$partial_payment_amount = ($cart_total * 20) / 100; | |
if ($amount >= $partial_payment_amount) { | |
$amount = $partial_payment_amount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode('terawallet-transfer', 'terawallet_transfer_shortcode_callback'); | |
if (!function_exists('terawallet_transfer_shortcode_callback')) { | |
function terawallet_transfer_shortcode_callback($atts) { | |
ob_start(); | |
wc_print_notices(); | |
if (!is_user_logged_in()) { | |
echo '<div class="woocommerce">'; | |
wc_get_template('myaccount/form-login.php'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode('terawallet-topup', 'terawallet_topup_shortcode'); | |
function terawallet_topup_shortcode(){ | |
ob_start(); | |
?> | |
<form method="post" action=""> | |
<div class="woo-wallet-add-amount"> | |
<label for="woo_wallet_balance_to_add"><?php _e( 'Enter amount', 'woo-wallet' ); ?></label> | |
<?php | |
$min_amount = woo_wallet()->settings_api->get_option( 'min_topup_amount', '_wallet_settings_general', 0 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode('terawallet-transactions', 'terawallet_transaction_shortcode'); | |
if(!function_exists('terawallet_transaction_shortcode')){ | |
function terawallet_transaction_shortcode(){ | |
wp_enqueue_style('woo-wallet-payment-jquery-ui'); | |
wp_enqueue_style('dashicons'); | |
wp_enqueue_style('select2'); | |
wp_enqueue_style('jquery-datatables-style'); | |
wp_enqueue_style('jquery-datatables-responsive-style'); | |
wp_enqueue_script('jquery-ui-datepicker'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('woocommerce_order_status_cancelled', 'debuct_wallet_recharge_amount'); | |
add_action('woocommerce_order_status_failed', 'debuct_wallet_recharge_amount'); | |
if(!function_exists('debuct_wallet_recharge_amount')){ | |
function debuct_wallet_recharge_amount($order_id){ | |
global $wpdb; | |
$order = wc_get_order($order_id); | |
$user_id = $order->get_customer_id(); | |
if(is_wallet_rechargeable_order($order)){ | |
$transaction_id = get_post_meta($order_id, '_wallet_payment_transaction_id', true); | |
if($transaction_id){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_update_order', 'woocommerce_update_order_callback' ); | |
if ( ! function_exists( 'woocommerce_update_order_callback' ) ) { | |
/** | |
* Auto deduct wallet balance while creating orders from backend. | |
* | |
* @param integer $order_id Order ID. | |
* @return void | |
*/ | |
function woocommerce_update_order_callback( $order_id ) { | |
$order = wc_get_order( $order_id ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode( 'terawallet-referral-link', 'terawallet_referral_link_shortcode_callback' ); | |
if ( ! function_exists( 'terawallet_referral_link_shortcode_callback' ) ) { | |
/** | |
* Display TeraWallet referral link shortcode. | |
* | |
* @return void | |
*/ | |
function terawallet_referral_link_shortcode_callback() { | |
$user_id = get_current_user_id(); | |
$user = new WP_User( $user_id ); |
OlderNewer