Skip to content

Instantly share code, notes, and snippets.

@verygoodplugins
Created September 6, 2022 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save verygoodplugins/4c53b481f3494725ca84f377f8dcda89 to your computer and use it in GitHub Desktop.
Save verygoodplugins/4c53b481f3494725ca84f377f8dcda89 to your computer and use it in GitHub Desktop.
Sync YITH Request A Quote pending orders to ActiveCampaign Deep Data as if they'd already been paid for
<?php
// Sync YITH Request A Quote pending orders to AC as if they'd been paid.
function add_custom_paid_status( $statuses ) {
$statuses[] = 'ywraq-new';
$statuses[] = 'ywraq-pending';
return $statuses;
}
add_filter( 'wpf_woocommerce_order_statuses', 'add_custom_paid_status' );
add_filter( 'woocommerce_order_is_paid_statuses', 'add_custom_paid_status' );
function schedule_order_sync( $order_id ) {
wp_schedule_single_event( time() + MINUTE_IN_SECONDS, 'wpf_handle_async_checkout_fallback', array( $order_id ) );
}
add_action( 'woocommerce_order_status_ywraq-new', 'schedule_order_sync' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment