Skip to content
Snippets Groups Projects

Fakturownia - oprócz nazwy firmy, dodaje imię i nazwisko kupującego do nazwy klienta

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Krzysztof Dyszczyk
    Fakturownia - oprócz nazwy firmy, dodaje imię i nazwisko kupującego do nazwy klienta.php 521 B
    add_filter( 'fakturownia/invoice/data', 'wpdesk_fakturownia_buyer_name', 10, 2 );
    function wpdesk_fakturownia_buyer_name( array $data, WPDesk\WooCommerceFakturownia\Data\DocumentData $document_data ) {
    	if ( ! empty( $document_data->getClientData()->getFirstName() ) ) {
    		$first_name         = $document_data->getClientData()->getFirstName();
    		$last_name          = $document_data->getClientData()->getLastName();
    		$data['buyer_name'] = $data['buyer_name'] . ', ' . $first_name . ' ' . $last_name;
    	}
    
    	return $data;
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment