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_currency_symbol', 'my_custom_currency_symbol', 10, 2) ; | |
function my_custom_currency_symbol( $currency_symbol, $currency ) { | |
switch( $currency ) { | |
case 'SEK': $currency_symbol = 'SEK'; | |
break; | |
} | |
return $currency_symbol; | |
} |
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
/** | |
* WooCommerce - DIBS payment gateway | |
* Filter the payment gateway icon used in checkout | |
* | |
**/ | |
// Credit card payment method | |
add_filter('wc_dibs_icon_html', 'my_wc_dibs_icon_html'); | |
function my_wc_dibs_icon_html( ) { |
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
/** | |
* Specter for WooCommerce | |
* Filter the Customer Order Reference sent to Specter. | |
* Useful when you want to pass extra order data that should be visible on the invoice or packing list sent to the customer. | |
* The default value of the Internal comment is the WooCommerce Order number. | |
* | |
**/ | |
add_filter('wc_specter_order_reference', 'my_custom_order_reference'); |
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
/** | |
* Specter for WooCommerce | |
* Filter the Internal Order Comment sent to Specter. | |
* Useful when you want to pass extra order data that only should be visible in Specter for you as a merchant. | |
* Internal Order Comment is not visible on invoices and packing lists for the customer to see. | |
* The default value of the Internal comment is the WooCommerce Order number. | |
* | |
**/ | |
add_filter('wc_specter_internal_comment', 'my_custom_internal_comment'); |
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
/** | |
* WooCommerce - Klarna payment gateway | |
* Filter the phone number returned from Klarna when customer pays via Klarna Checkout. | |
* Useful when you want to add the country prefix to the phone number. | |
* | |
**/ | |
add_filter('klarna_checkout_billing_phone', 'my_custom_klarna_checkout_billing_phone'); | |
function my_custom_klarna_checkout_billing_phone( $phone_number ) { |
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
/** | |
* DIBS payment gateway for WooCommerce | |
* Filter the language parameter sent to DIBS. | |
* Useful when you want the language of the DIBS Payment Window to match the language in your WooCommerce store. | |
* | |
**/ | |
add_filter( 'dibs_language', 'my_dibs_language' ); | |
function my_dibs_language() { |
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
/** | |
* WooCommerce - Klarna payment gateway | |
* Don't display the Klarna Checkout form if cart is less than the specified amount. | |
* Useful when you only want to have KCO as an available payment method for orders above a specific order amount. | |
* | |
**/ | |
// Check to see if the KCO checkout should be displayed | |
add_filter('klarna_kco_checkout', 'my_klarna_kco_checkout'); | |
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 an acquirerinfo parameter sent to DIBS | |
**/ | |
add_filter('dibs_checkout_form', 'my_dibs_checkout_form', 10, 3); | |
function my_dibs_checkout_form( $args, $paytype, $order ) { | |
$args['acquirerinfo'] = ltrim( $order->get_order_number(), '#'); | |
return $args; | |
} |
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
/** | |
* Filter hook wc_specter_send_custom_product_data | |
* Add custom parameters to products sent to Specter. | |
* The product data will be passed to Specter both on single product update (save_post) | |
* and on manually triggered product exports (from the Specter settings page). | |
* Contact Specter for detailed information on what parameters their system accepts. | |
**/ | |
add_filter( 'wc_specter_send_custom_product_data', 'my_custom_product_data', 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
/** | |
* Action hook wc_specter_received_product_data | |
* Save custom product data received from Specter on product updates/changes in Specters system. | |
* | |
**/ | |
add_action( 'wc_specter_received_product_data', 'my_custom_product_update' ); | |
function my_custom_product_update( $article ) { | |
// Update your product here. $article is the returned product data from Specter, stored as an array. |