Skip to content

Instantly share code, notes, and snippets.

@claudiosanches
Last active December 16, 2015 10:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claudiosanches/5424549 to your computer and use it in GitHub Desktop.
Save claudiosanches/5424549 to your computer and use it in GitHub Desktop.
Fix WooCommerce Boleto ID with WooCommerce Sequential Order Numbers
<?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