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 | |
// remove Store name from merchant_ref field for First Data Payeezy | |
add_filter( 'wc_payment_gateway_first_data_payeezy_credit_card_get_order_base', function( $order ) { | |
$order->description = sprintf( 'Order #%1$s', $order->get_order_number() ); | |
return $order; | |
}, 1 ); |
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', function( $response ) { | |
// strip leading woocommerce_ from payment method | |
if ( ! empty( $response->data['payment_method'] ) ) { | |
$response->data['payment_method'] = str_replace( 'woocommerce_first_data_', '', $response->data['payment_method'] ); | |
} | |
return $response; |
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( 'init', 'jilt_for_wc_add_custom_email_capture' ); | |
function jilt_for_wc_add_custom_email_capture() { | |
if ( function_exists( 'wc_enqueue_js' ) ) { | |
ob_start(); | |
?> | |
$(window).load(function() { | |
var opts = { | |
callback: function (value) { |
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( 'wc_jilt_order_is_placed', function( $placed, $order ) { | |
return $placed || ( 'pending' == $order->get_status() && 'divido' == $order->get_payment_method() ); | |
}, 10, 2 ); |
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_debug_tools', function( $tools ) { | |
$tools['wc_jilt_clear_persistent_carts'] = array( | |
'name' => __( 'Clear Persistent Carts from customers who signed up over 30 days ago.', 'jilt-for-woocommerce' ), | |
'button' => __( 'Clear', 'woocommerce-plugin-framework' ), | |
'desc' => __( 'This tool will clear the persistent cart for all registered customers who signed up over 30 days ago.', 'jilt-for-woocommerce' ), | |
'callback' => 'wc_jilt_clear_persistent_carts' | |
); | |
return $tools; |
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_coupon_get_individual_use', function( $individual_use, $coupon ) { | |
if ( $coupon->meta_exists( 'jilt_discount_id' ) ) { | |
$individual_use = true; | |
} | |
return $individual_use; | |
}, 10, 2 ); |
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( 'init', function() { | |
if ( is_callable( 'wc_jilt' ) ) { | |
remove_filter( 'woocommerce_checkout_fields', array( wc_jilt()->get_checkout_handler_instance(), 'move_checkout_email_field' ), 1 ); | |
} | |
}, 20 ); |
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_get_checkout_url', function( $checkout_url ) { | |
global $wp; | |
if ( isset( $wp->query_vars ) && ! empty( $wp->query_vars['wc-api'] ) && 'jilt' === $wp->query_vars['wc-api'] && ! empty( $_GET['token'] ) ) { | |
$checkout_url = wc_get_cart_url(); | |
} | |
return $checkout_url; | |
} ); |
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 customer IP column header | |
function wc_csv_export_add_customer_ip_column_header( $column_headers ) { | |
$new_headers = array( | |
'customer_ip' => 'customer_ip', | |
); | |
return array_merge( $column_headers, $new_headers ); |
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 | |
// force the "securely save to account" checkbox to default to checked | |
function wc_auth_net_cim_save_payment_method_default_checked( $html, $form ) { | |
if ( empty( $html ) || $form->tokenization_forced() ) { | |
return $html; | |
} | |
return str_replace( 'type="checkbox"', 'type="checkbox" checked="checked"', $html ); | |
} |
NewerOlder