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
add_action( 'woocommerce_receipt_epaybg', 'vanbo_initiate_epaybg_request_hooks', 9 ); | |
/** | |
* Replaces the gateway original action with our own | |
*/ | |
function vanbo_initiate_epaybg_request_hooks() { | |
$gateway = vanbo_get_epaybg_gateway(); | |
if ( false == $gateway ) { | |
return; | |
} |
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
/** | |
* IMPORTANT: Past this snippet to your "child-theme\functions.php" file. | |
*/ | |
add_action( 'init', 'vanbo_store_polylang_language', 99 ); | |
/** | |
* Saves the Polylang last used language by the current user | |
*/ | |
function vanbo_store_polylang_language() { | |
if ( ! function_exists( 'WC' ) || ! WC()->session ) { |
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
/** | |
* IMPORTANT: Add the code to your "child-theme/functions.php" file | |
*/ | |
add_filter( 'wc_trustcommerce_process_single_payment_request', 'vanbo_tc_add_operator_to_requests', 10 ); | |
add_filter( 'wc_trustcommerce_process_profile_payment_request_request', 'vanbo_tc_add_operator_to_requests', 10 ); | |
add_filter( 'wc_trustcommerce_create_customer_profile_request', 'vanbo_tc_add_operator_to_requests', 10 ); | |
add_filter( 'wc_trustcommerce_update_customer_profile_request', 'vanbo_tc_add_operator_to_requests', 10 ); | |
add_filter( 'wc_refund_payment_request_trustcommerce', 'vanbo_tc_add_operator_to_requests', 10 ); | |
add_filter( 'wc_capture_payment_request_trustcommerce', 'vanbo_tc_add_operator_to_requests', 10 ); |
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
/** | |
* NOTE: Add the code to your "child-theme/functions.php" file | |
*/ | |
add_filter( 'wc_borica_form_request_parameters', 'vanbodevelops_filter_borica_request', 10, 3 ); | |
function vanbodevelops_filter_borica_request( $params, $order, $gateway ) { | |
// NOTE: Use each block as needed. | |
// 1. Change the Borica payment page language | |
// 'BG' - bulgarian, 'EN' - english | |
$params['language'] = 'EN'; |
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
/** | |
* Cancel all failed orders after held duration | |
* The method is adapted from the WooCommerce "wc_cancel_unpaid_orders" function and uses 'woocommerce_cancel_unpaid_orders' schedule hook | |
* | |
* Code location: Add the code to your "child-theme/functions.php" file | |
* | |
* Requirements: "Product > Inventory > Manage Stock" enabled, and time set in the "Product > Inventory > Hold stock (minutes)" setting. | |
*/ | |
function vanbo_cancel_failed_orders() { | |
$held_duration = get_option( 'woocommerce_hold_stock_minutes' ); |
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
add_filter( 'wc_paysafe_layover_on_checkout', 'vanbo_wc_paysafe_layover_on_checkout' ); | |
function vanbo_wc_paysafe_layover_on_checkout( $on_checkout ) { | |
return true; | |
} |
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
add_action( 'admin_init', 'vanbo_update_order_status', 10 ); | |
function vanbo_update_order_status() { | |
// We need the 'post', 'action' = edit, and 'prefix-change-status' to be set. | |
// If even one is not set, bail | |
if ( ! isset( $_GET['post'] ) | |
|| ( ! isset( $_GET['action'] ) || 'edit' != $_GET['action'] ) | |
|| ! isset( $_GET['prefix-change-status'] ) ) { | |
return; | |
} |
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
/** | |
* NOTE: Add the code to the 'theme/functions.php" file | |
*/ | |
add_filter( 'wc_paytrace_request_timeout', 'vanbo_paytrace_edit_timeout', 10 ); | |
/** | |
* @param int $timeout The current seconds | |
* | |
* @return int Return the seconds you want the timeout to be | |
*/ | |
function vanbo_paytrace_edit_timeout($timeout){ |
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
add_action( 'http_api_curl', 'paytrace_http_api_curl', 10, 3 ); | |
/** | |
* Force posts to Paytrace to use TLS v1.2. | |
* | |
* @param string $handle | |
* @param mixed $r | |
* @param string $url | |
*/ | |
function paytrace_http_api_curl( $handle, $r, $url ) { | |
if ( strstr( $url, 'https://' ) && ( strstr( $url, 'api.paytrace.com' ) || strstr( $url, 'paytrace.com/api' ) ) ) { |
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
/** | |
* Place the code in your theme/functions.php file | |
*/ | |
add_filter( 'wc_epay_one_touch_payment_setup_params', 'prefix_epaytouch_setup_params', 10, 4 ); | |
function prefix_epaytouch_setup_params( $params, $device_id, $token, $account_payment_class ) { | |
if ( isset( $params['EXP'] ) ) { | |
// remove the expiration time | |
unset( $params['EXP'] ); | |
} | |