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
// Recurring Total line items | |
add_filter( 'woocommerce_subscription_price_string', 'wc_subscription_recurring_price_string', 10, 2 ); | |
function wc_subscription_recurring_price_string( $subscription_string, $subscription_details ) { | |
if ( ( is_checkout() && ! is_wc_endpoint_url() ) ) { | |
$recurring_amount = $subscription_details['recurring_amount']; | |
//If this is a switch order with a Specific Coupon applied | |
if( WC()->cart->get_total( 'edit' ) == 0.00 && WC()->cart->has_discount( 'COUPON-NAME-HERE' ) && strpos($recurring_amount, '149.00') !== false){ | |
return $recurring_amount . ' / 1st year<br>then $199.00 / year'; | |
} else { |
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('woocommerce_checkout_show_terms', 'remove_terms_and_conditions_checkbox_for_specific_category'); | |
function remove_terms_and_conditions_checkbox_for_specific_category($show_terms) { | |
// Check if WooCommerce is active and the cart object is available | |
if (in_array('woocommerce/woocommerce.php', get_option('active_plugins')) && WC()->cart) { | |
// Define the product category slug to check for | |
$targeted_category_slug = 'your-product-cat-slug-here'; | |
// Get the cart contents | |
$cart_items = WC()->cart->get_cart(); |
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 Bulk Enroll / Remove options for each LearnDash Course in User List | |
---*/ | |
function add_course_bulk_actions( $actions ) { | |
$courses = get_posts( array( | |
'post_type' => 'sfwd-courses', | |
'posts_per_page' => -1, | |
'post_status' => 'publish', | |
) ); |
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
/*-- Disable Recurring Refferals On New Affiliate --*/ | |
function set_recurring_disabled_on_new_affiliate( $affiliate_id ) { | |
affwp_update_affiliate_meta( $affiliate_id, 'recurring_disabled', 1 ); | |
} | |
add_action( 'affwp_insert_affiliate', 'set_recurring_disabled_on_new_affiliate' ); | |
/*-- Bulk Disable Recurring Refferal on Affiliate List --*/ | |
add_filter( 'affwp_affiliates_bulk_actions', 'bulk_disable_recurring_refferrals_name' ); | |
function bulk_disable_recurring_refferrals_name($actions){ | |
$actions['disablerecurring'] = 'Disable Recurring Refferals'; |
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
<?php | |
/** | |
* Plugin Name: AffiliateWP - Store Credit - Disable Store Credit Per Affiliate | |
* Plugin URI: https://affiliatewp.com | |
* Description: Disable store credit per affiliate if store credit is globally enabled for all affiliates | |
* Author: Tunbosun Ayinla | |
* Author URI: https://affiliatewp.com | |
* Version: 1.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
// When click on notification then move to particular reply. | |
moveToReply: function () { | |
if ( window.location.href.indexOf( '#post-' ) > 0 ) { | |
var varUrl = window.location.href.split( '#post-' ); | |
var postID = varUrl && undefined !== varUrl[1] ? varUrl[1] : ''; | |
if ( !postID ) { | |
return; | |
} | |
var scrollTop; | |
if ($('#wpadminbar').length){ |
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 customer name to reference column of the referrals page | |
*/ | |
function affwp_custom_wc_referrals_user_link( $reference, $referral ) { | |
if ( ! ( 'woocommerce' == $referral->context || class_exists( 'WC_Order' ) ) ) { | |
return $reference; | |
} | |
$order = wc_get_order( $referral->reference ); | |
if( ! $order ){ |
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_coupon_options', 'affwp_only_referral_coupon_option' ); | |
add_action( 'woocommerce_coupon_options_save', 'affwp_store_only_referral_coupon_option' ); | |
add_filter( 'woocommerce_coupon_is_valid', 'affwp_custom_block_coupon_if_no_referrer', 10, 2 ); | |
/** | |
* Add coupon option to enable only referral validity | |
*/ | |
function affwp_only_referral_coupon_option() { | |
global $post; |
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
//array of restricted user IDs | |
function bp_restricted_user_list(){ | |
// These user's won't be able to receive the messages. | |
$restricted_user_ids = array( 102, 115, 220, 225 ); //Change these values to valid user IDs | |
return $restricted_user_ids; | |
} | |
/** | |
* Is user restricted from receiving message. |
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
<?php foreach( get_users( array( 'role__in' => array( 'administrator', 'editor', 'author', 'contributor' ) ) ) as $author) { ?> |