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 | |
/** | |
* @since 3.4.3 | |
*/ | |
add_filter( 'automatewoo/workflow/mailer', 'my_filter_automatewoo_workflow_mailer' ); | |
/** | |
* @param AutomateWoo\Mailer $mailer | |
* @return AutomateWoo\Mailer |
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 a specific workflow for a specific order. | |
* | |
* @param int $workflow_id | |
* @param int $order_id | |
* | |
* @throws \Exception | |
*/ |
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 | |
/** | |
* AutomateWoo: Make generated coupon descriptions match the template coupon. | |
* | |
* Requires AutomateWoo 5.2. | |
*/ | |
add_action( | |
'automatewoo/coupon_generator/generate_from_template_coupon', | |
function ( $coupon, $template_coupon ) { |
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 | |
defined( 'ABSPATH' ) || exit; | |
/** | |
* Custom Rule: Order - Delivery Date | |
* | |
* This is an example of creating a custom date rule that uses a meta field as the date value. | |
* By extending the AutomateWoo\Rules\Abstract_Date class we can use the existing date comparison types with this custom rule. | |
* For more about date-based rules see: https://automatewoo.com/docs/rules/date-based-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 | |
add_filter( 'woocommerce_rest_prepare_shop_order_object', 'my_automatewoo_referrals_add_advocate_coupon_to_order_api', 10, 3 ); | |
/** | |
* AutomateWoo Refer A Friend - Add customer's referral coupon to order objects returned from REST API | |
* | |
* Because guest customers can't be advocates only orders by registered users will have the code added. | |
* |
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_free_gift_coupon_data', 10, 4 ); | |
/** | |
* Make AutomateWoo Refer A Friend coupons free gift coupons. | |
* | |
* REQUIRES: WooCommerce v3.6 and Refer A Friend v2.3.1 | |
* REQUIRES: https://woocommerce.com/products/free-gift-coupons/ | |
* |
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 | |
$user_id = 1; | |
$advocate = \AutomateWoo\Referrals\Advocate_Factory::get( $user_id ); | |
// Retrieve or generate a shareable referral coupon (coupon sharing only) | |
$advocate->get_shareable_coupon(); | |
// Retrieve or generate a shareable referral link (link sharing only) | |
$advocate->get_shareable_link(); |
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 | |
// Prevent email capture and session tracking from the comment form | |
add_action( 'automatewoo_loaded', function() { | |
remove_action( 'comment_post', [ 'AutomateWoo\Session_Tracker', 'capture_from_comment' ] ); | |
}); |
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 | |
// Requires AW 4.3 | |
// create date object | |
$date = new AutomateWoo\DateTime( '2018-07-23 06:12:04' ); | |
// get the queued event by ID | |
$event = AutomateWoo\Queued_Event_Factory::get( $event_id ); | |
$event->set_date_due( $date ); |
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 | |
/** | |
* Using this filter will completely override the value of 'Require cookie consent' in settings. | |
* Presubmit tracking is depending on session tracking so this filter will also control when presubmit tracking is permitted | |
* (unless presubmit tracking is completely disabled in settings). | |
*/ | |
add_filter( 'automatewoo/session_tracking/cookies_permitted', 'my_filter_automatewoo_session_tracking_cookies_permitted' ); | |
/** |
OlderNewer