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_custom_validate_workflow', 'my_custom_workflow_validation' ); | |
/** | |
* @param bool $valid | |
* @param AW_Model_Workflow $workflow | |
* | |
* @return bool | |
*/ |
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 | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Prevent direct access | |
} | |
/** | |
* This is an example trigger that is triggered via a WordPress action and includes a user data item. | |
* Trigger with: do_action('my_custom_action', $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 | |
/** | |
* An example of how to filtering the value of a variable | |
* | |
* In this example we will format user first and last names. | |
*/ | |
add_filter( 'automatewoo/variables/after_get_value', 'my_automatewoo_variable_filter_names', 10, 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 | |
/** | |
* Add the custom variable to the list | |
*/ | |
add_filter( 'automatewoo/variables', 'my_automatewoo_variables' ); | |
/** | |
* @param $variables array | |
* @return array | |
*/ |
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/rules/includes', 'my_automatewoo_rules' ); | |
/** | |
* @param array $rules | |
* @return array | |
*/ | |
function my_automatewoo_rules( $rules ) { | |
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 | |
foreach( $users as $user_id ) | |
{ | |
// fetch the existing key | |
// please note that the key should NOT include the referral prefix | |
// so if your prefix is 'REF' then the final coupon here will be 'REF1234' | |
$key = '1234' | |
$object = new AW_Model_Referral_Advocate_Key(); |
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/guest_capture_fields', 'my_guest_capture_fields' ); | |
/** | |
* @param array $selectors | |
*/ | |
function my_guest_capture_fields( $selectors ) { | |
$selectors[] = '#example-id-selector'; | |
$selectors[] = '.example-class-selector'; |
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 | |
// In addition to adding this code you should set the Coupon Expiry setting to zero to disable coupon expiry | |
add_filter('automatewoo/referrals/generate_advocate_key', 'my_automatewoo_referrals_generate_advocate_key', 10, 2 ); | |
/** | |
* @param $key | |
* @param AW_Model_Referral_Advocate $advocate | |
* @return int|string |
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/coupon_data', 'my_automatewoo_referrals_coupon_data' ); | |
/** | |
* Restrict referral coupon to product IDs | |
* | |
* @param array $coupon_data | |
* @return array | |
*/ |
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/validate_coupon_for_user', 'my_automatewoo_referral_coupon_validate', 10, 3 ); | |
add_filter( 'automatewoo/referrals/validate_coupon_for_guest', 'my_automatewoo_referral_coupon_validate', 10, 3 ); | |
/** | |
* $valid is true if coupon is valid for user or an instance of WP_Error if the coupon is invalid | |
* | |
* @param WP_Error|true $valid |
OlderNewer