Last active
December 16, 2015 10:59
-
-
Save claudiosanches/5424549 to your computer and use it in GitHub Desktop.
Fix WooCommerce Boleto ID with WooCommerce Sequential Order Numbers
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 | |
/** | |
* Plugin Name: Fix WooCommerce Boleto ID with WooCommerce Sequential Order Numbers | |
* Plugin URI: http://claudiosmweb.com/ | |
* Description: WooCommerce Boleto is a brazilian payment gateway for WooCommerce | |
* Author: claudiosanches | |
* Author URI: http://claudiosmweb.com/ | |
* Version: 0.1 | |
* License: GPLv2 or later | |
*/ | |
/** | |
* Fix WooCommerce Boleto ID with WooCommerce Sequential Order Numbers. | |
* | |
* @param int $id Original ID. | |
* | |
* @return int New ID. | |
*/ | |
function fix_boleto_id( $id ) { | |
return get_post_meta( $id, '_order_number', true ); | |
} | |
add_filter( 'wcboleto_our_number', 'fix_boleto_id' ); | |
add_filter( 'wcboleto_document_number', 'fix_boleto_id' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment