wc_boleto_get_boleto_url_by_order_id

Get boleto URL from order key.

Description

(string) wc_boleto_get_boleto_url_by_order_id( (int) $order_id ); 

Returns (string)

Parameters (1)

0. $order_id (int)
The order id.

Usage

  1. if ( !function_exists( 'wc_boleto_get_boleto_url_by_order_id' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-boleto/includes/wc-boleto-functions.php'; 
  3.  
  4. // The order id. 
  5. $order_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_boleto_get_boleto_url_by_order_id($order_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-boleto-functions.php  
  1. function wc_boleto_get_boleto_url_by_order_id( $order_id ) { 
  2. $order_id = intval( $order_id ); 
  3. $order = new WC_Order( $order_id ); 
  4.  
  5. if ( isset( $order->order_key ) ) { 
  6. return wc_boleto_get_boleto_url( $order->order_key ); 
  7.  
  8. return '';