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( 'woocommerce_wirecard_icon', 'wirecard_filter_gateway_icon' ); | |
function wirecard_filter_gateway_icon( $icon ) { | |
$icon = 'path/to/your/gateway/icon.png'; | |
return $icon; | |
} |
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('my_do_active_user_message_hook', 'check_header_for_active_user'); | |
/** | |
* Check for the set activated user and echo a message on the home page | |
*/ | |
function check_header_for_active_user() { | |
if ( ! session_id() ) { | |
session_start(); | |
} | |
if ( isset($_SESSION['my_active_user_variable']) && ! empty( $_SESSION['my_active_user_variable'] ) ) { | |
$user = $_SESSION['my_active_user_variable']; |
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
// Use the filter to any status to the Order sync watch list. | |
add_filter( 'wc_tradegecko_query_orders_status', 'wc_tg_add_orders_sync_statuses' ); | |
function wc_tg_add_orders_sync_statuses( $statuses ) { | |
// Here you add all statuses that you want to support. | |
// They should be in array format and the value should be the status slug | |
// For WC 2.2+ statuses are added with "wc-" prefix, like this | |
$statuses[] = 'wc-pending'; // for Pending Payment status | |
$statuses[] = 'wc-on-hold'; // for On Hold status | |
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 the code to your theme functions.php file | |
*/ | |
// Remove the order meta function from the email | |
remove_action( 'woocommerce_email_order_meta', array( WC()->mailer(), 'order_meta' ), 10, 3 ); | |
// Add your own order meta function | |
add_action( 'woocommerce_email_order_meta', 'woo_add_order_notes_to_email', 10, 3 ); | |
function woo_add_order_notes_to_email( $order, $sent_to_admin = true, $plain_text = false ) { |
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
/** | |
* You need the order object here. | |
* So we'll assume you already have it. | |
* | |
* To get the order you can call | |
* $order = wc_get_order( $order_id ); | |
*/ | |
// Get Order items | |
$items = $order->get_items(); |
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 | |
\Stripe\Stripe::setApiKey('the_key'); | |
// I do set this usually, but tried without it, too | |
\Stripe\Stripe::setApiVersion('2016-03-07'); | |
$card = array( | |
'number' => '4242424242424242', | |
'exp_month' => 5, |
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_linnworks_orders_discount_sku_name', 'linnworks_change_discount_item_sku' ); | |
function linnworks_change_discount_item_sku($sku) { | |
// Change the SKU value by returning a new value | |
return 'NEW-SKU-HERE'; | |
} |
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_borica_certificates_password', 'prefix_add_filter' ); | |
function prefix_add_filter( $name ) { | |
return 'your-password-here'; | |
} |
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
if ( ! function_exists( 'your_site_curl_ssl_v3' ) ) { | |
add_action( 'http_api_curl', 'your_site_curl_ssl_v3' ); | |
function your_site_curl_ssl_v3( $handle ) { | |
curl_setopt($handle, CURLOPT_SSLVERSION, 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
// Normal order | |
add_filter( 'wc_paysafe_request_params', 'prefix_remove_ip_address', 10, 2 ); | |
// Subscriptions/Pre-Orders order | |
add_filter( 'wc_paysafe_addons_request_params', 'prefix_remove_ip_address', 10, 2 ); | |
function prefix_remove_ip_address( $params, $order ) { | |
if ( isset( $params['customerIp'] ) ) { | |
unset( $params['customerIp'] ); | |
} | |
return $params; |
OlderNewer