This file contains 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 | |
add_filter( 'woocommerce_order_is_paid_statuses', 'my_custom_woocommerce_order_is_paid_statuses' ); | |
/** | |
* @param array $statuses | |
* @return array | |
*/ | |
function my_custom_woocommerce_order_is_paid_statuses( $statuses ) { | |
// already included statuses are processing and completed |
This file contains 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 | |
add_filter( 'automatewoo/referrals/reward_amount', 'filter_automatewoo_referrals_reward_amount', 10, 3 ); | |
/** | |
* @param float $reward_amount | |
* @param \AutomateWoo\Referrals\Advocate $advocate | |
* @param \WC_Order $order | |
* @return float | |
*/ |
This file contains 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 | |
// Run AutomateWoo events every 5 minutes instead of every minute | |
add_action( 'automatewoo_loaded', function() { | |
remove_action( 'automatewoo_events_worker', [ 'AutomateWoo\Cron', 'before_worker' ], 1 ); | |
remove_action( 'automatewoo_events_worker', [ 'AutomateWoo\Events', 'run_due_events' ] ); | |
add_action( 'automatewoo_five_minute_worker', [ 'AutomateWoo\Events', 'run_due_events' ] ); | |
} ); |
This file contains 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 | |
add_filter( 'automatewoo/referrals/advocate_id', 'my_filter_automatewoo_advocate_id_for_team_leader' ); | |
/** | |
* @param $user_id | |
* @return int | |
*/ | |
function my_filter_automatewoo_advocate_id_for_team_leader( $user_id ) { |
This file contains 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 | |
add_action( 'automatewoo_loaded', function() { | |
remove_action( 'automatewoo_five_minute_worker', [ 'AutomateWoo\Queue_Manager', 'check_for_queued_events' ] ); | |
add_action( 'automatewoo_events_worker', [ 'AutomateWoo\Queue_Manager', 'check_for_queued_events' ] ); | |
} ); |
This file contains 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 | |
add_filter( 'automatewoo/referrals/account_tab_share_link_text', function() { | |
return __( 'Insert custom share link text here.', 'text-domain' ); | |
}); |
This file contains 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 | |
add_filter( 'automatewoo/referrals/account_tab_title', function() { | |
return 'My Custom Tab Name'; | |
}); |
This file contains 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 | |
// Please note, once the length is changed you may need to delete the advocate's existing coupon | |
// before new coupons with the new length will be generated. | |
add_filter( 'automatewoo/referrals/coupon_key_length', function(){ | |
return 5; | |
}); |
This file contains 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 | |
// WARNING! If you change the prefix all existing coupons will no longer work. | |
// Default coupon prefix is 'REF' | |
add_filter( 'automatewoo/referrals/coupon_prefix', function(){ | |
return 'MY_PREFIX'; | |
}); |
This file contains 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 | |
/** | |
* Adding a domain to the 'allowed_redirect_hosts' filter means AutomateWoo will use click tracking for URLs | |
* on this domain. Otherwise only URLs matching the site's domain will use click tracking for security reasons. | |
* | |
* @param array $hosts | |
* @return array | |
*/ | |
add_filter( 'allowed_redirect_hosts', function( $hosts ) { |