Skip to content

Instantly share code, notes, and snippets.

@gausam
Created March 15, 2021 16:54
Show Gist options
  • Save gausam/fa571a20f438049fba3e3b627343189d to your computer and use it in GitHub Desktop.
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.
<?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