woocommerce_order_formatted_billing_address

FILTER woocommerce\includes\class-wc-order.php (ligne 1036) github
Get a formatted billing address for the order.
traduction française
Obtenir une adresse de facturation formatée pour la commande.

Paramètres

Entrée :
$this->get_address( 'billing'
Sortie :
@param string $empty_content Content to show if no address is present. @since 3.3.0.
@return string

Utilisation

Formater l'adresse de facturation

Personnaliser l'affichage de l'adresse de facturation

order-flow
// Format adresse facturation
add_filter('woocommerce_order_formatted_billing_address', 'format_adresse_facturation', 10, 2);

function format_adresse_facturation($address, $order) {
    // Ajouter le numéro de TVA si présent
    $vat = get_post_meta($order->get_id(), '_billing_vat_number', true);
    if ($vat) {
        $address['vat'] = 'TVA : ' . $vat;
    }
    
    return $address;
}

Actualités

Chargement des actualités...