View jilt-for-wc-watch-email.php
<?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) { |
View jilt-for-woocommerce-order-is-placed-filter.php
<?php | |
add_filter( 'wc_jilt_order_is_placed', function( $placed, $order ) { | |
return $placed || ( 'pending' == $order->get_status() && 'divido' == $order->get_payment_method() ); | |
}, 10, 2 ); |
View jilt-for-wc-clear-persistent-carts.php
<?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; |
View jilt-for-wc-force-individual-use-coupons.php
<?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 ); |
View jilt-for-wc-disable-email-field-move.php
<?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 ); |
View jilt-for-wc-recovery-link-redirect-to-cart.php
<?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; | |
} ); |
View wc-customer-order-csv-export-add-order-customer-ip.php
<?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 ); |
View wc-auth-net-cim-save-payment-method-default-checked.php
<?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 ); | |
} |
View wc-auth-net-cim-adjust-auth-only-order-status.php
<?php | |
function sv_wc_auth_net_cim_tweak_held_order_status( $order_status, $order, $response ) { | |
if ( 'on-hold' === $order_status && $response instanceof SV_WC_Payment_Gateway_API_Response && $response->transaction_approved() ) { | |
$order_status = 'processing'; | |
} | |
return $order_status; | |
} |
View wc-local-pickup-plus-remove-pickup-location.php
function wc_local_pickup_plus_remove_pickup_location() { | |
$methods = WC()->shipping->load_shipping_methods(); | |
if ( isset( $methods['local_pickup_plus'] ) ) { | |
remove_action( 'woocommerce_after_template_part', array( $methods['local_pickup_plus'], 'review_order_shipping_pickup_location' ), 10, 4 ); | |
} | |
} | |
add_action( 'wc_shipping_local_pickup_plus_init', 'wc_local_pickup_plus_remove_pickup_location' ); |
NewerOlder