kmalber
Forum Replies Created
-
Forum: Plugins
In reply to: [Basic User Avatars] Does Basic User Avatar work with Ultimate Member?Thanks Michael. I can try that. Unfortunately, I am reliant on Ultimate Member which I have customized significantly with additional code. I suspect it might be that custom code which is the culprit, but wondered if anyone else had successfully used this plugin with vanilla Ultimate Member to narrow my focus. Entirely likely I may have to custom code my own solution here.
Forum: Themes and Templates
In reply to: [Blocksy] outdated woocommerce cart.php 7.0.1Will do. Have a wonderful day.
Forum: Themes and Templates
In reply to: [Blocksy] outdated woocommerce cart.php 7.0.1Many thanks for your quick attention and reply. Just updated and all looks good.
Forum: Plugins
In reply to: [Wallet for WooCommerce] allow terawallet topup conditionallyThanks Subrata. In case it helps anyone else, here’s the code I’m using:
add_filter('woo_wallet_is_enable_top_up', 'ka_limit_topup_to_neg_bal'); function ka_limit_topup_to_neg_bal($enable_flag){ $user = wp_get_current_user(); $current_user_id = $user->ID; $wallet_bal = woo_wallet()->wallet->get_wallet_balance($current_user_id, ''); $enable_flag = FALSE; //initialize to not allow top_up unless debit balance // if a debit balance exists, allow payment if ($wallet_bal<0) { $enable_flag = TRUE; } return $enable_flag; }Forum: Plugins
In reply to: [Wallet for WooCommerce] Way to customize Terawallet error messageWorked like a charm! Thank you so much for your help Subrata.
Forum: Plugins
In reply to: [Wallet for WooCommerce] Way to customize Terawallet error messageI think I may have figured it out. I amended the code to add a wc_clear_notices() prior to the wc_add_notice (code below). This appears to be working. Would you know if there is any reason which would counter-indicate using this method (eg could there be situations where there are stored notices besides this one error message that I wouldn’t want to clear)? Thanks so much for your help.
add_filter(‘woocommerce_add_to_cart_validation’, ‘ka_neg_balance_msg’, 20);
function ka_neg_balance_msg($valid ){
$product = get_wallet_rechargeable_product();
if ( is_wallet_rechargeable_cart() ) {
wc_clear_notices();
wc_add_notice( apply_filters( ‘woo_wallet_restrict_other_from_add_to_cart’, __( ‘NEW MESSAGE WORDING’, ‘woo-wallet’ ) ), ‘error’ );
$valid = false;
}
return $valid;
}`Forum: Plugins
In reply to: [Wallet for WooCommerce] Way to customize Terawallet error messageThank you both so much for your quick reply. I am relatively new to this and hope you might be able to provide a little more direction as to how to use the plugin filter. I have investigated the woo-wallet front end code to see where the filter function is defined and the hook at which it is added. I tried copying the function code into my function.php, modifying it to include my preferred message wording and hooking it to the same hook used in the front end code. The result is that the new error message is appended to the default message. Would you be able to instruct as to how I might instead remove the default message and replace it with my preferred text? Any help you could give would be most gratefully appreciated!
add_filter(‘woocommerce_add_to_cart_validation’, ‘ka_neg_balance_msg’, 20);
function ka_neg_balance_msg($valid ){
$product = get_wallet_rechargeable_product();
if ( is_wallet_rechargeable_cart() ) {
wc_add_notice( apply_filters( ‘woo_wallet_restrict_other_from_add_to_cart’, __( ‘NEW MESSAGE WORDING’, ‘woo-wallet’ ) ), ‘error’ );
$valid = false;
}
return $valid;
}`