Created
March 15, 2021 16:54
-
-
Save gausam/fa571a20f438049fba3e3b627343189d to your computer and use it in GitHub Desktop.
[Yoco WooCommerce] Use the order's display order number as the transaction description during checkout.
This file contains hidden or 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 | |
/** | |
* This recipe modifies the Yoco plugin to use the order's display order number | |
* as the transaction description during checkout. | |
* | |
* It is intended for use with the Yoco Payments plugin for WooCommerce: | |
* https://wordpress.org/plugins/yoco-payment-gateway/ | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress | |
* repository - https://wordpress.org/plugins/code-snippets/. | |
*/ | |
function my_wc_yoco_popup_configuration( $yoco_popup_configuration, $order ) { | |
$yoco_popup_configuration['description'] = $order->get_order_number(); | |
return $yoco_popup_configuration; | |
} | |
add_filter( 'wc_yoco_popup_configuration', 'my_wc_yoco_popup_configuration', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment