Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the simple-custom-post-order domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/staging.wpify.io/web/wp/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the woocommerce domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/staging.wpify.io/web/wp/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the woocommerce-subscriptions domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/staging.wpify.io/web/wp/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wpify-woo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/staging.wpify.io/web/wp/wp-includes/functions.php on line 6114
Upravení dat subjektu (kontaktu) – WPify

Dokumentace

Upravení dat subjektu (kontaktu)

Pokud potřebujete upravit data odesílaná do Fakturaidu za účelem vytvoření kontaktu můžete k tomu využít připravený filtr:

apply_filters( 'wpify_woo_fakturoid_subject_data', $data, $order, $wc_order )

Aktuálně odesílaná data jsou

$data = array(
  'name'            // Fakturační jméno společnosti nebo celé jméno
  'street'          // Fakturační ulice a číslo popisné
  'city'            // Fakturační město
  'zip'             // Fakturační PSČ
  'country'         // Fakturační země
  'registration_no' // Fakturační IČO
  'vat_no'          // Fakturační DIČ
  'local_vat_no'    // Fakturační IČ DPH (pro SR)
  'full_name'       // Fakturační celé jméno
  'email'           // Fakturační email
  'phone'           // Fakturační telefon
  'custom_id'       // id přihlášeného uživatele (je-li přihlášen)
);

Příklad vlastní funkce pro úpravu dat v které se rozděluje první a druhý řádek fakturační adresy do samostatných polí.

/**
 * Edit Fakturoid subject data
 * 
 * @param array                               $data     Data
 * @param WpifyWooFakturoid\Models\OrderModel $order    Order model with Fakturoid data
 * @param WC_Order                            $wc_order WC order
 *
 * @return array
 */
function edit_fakturoid_subject_data( $data, $order, $wc_order ): array {
	$data['street']  = $wc_order->get_billing_address_1();
	$data['street2'] = $wc_order->get_billing_address_2();

	return $data;
}
add_action( 'wpify_woo_fakturoid_subject_data', 'edit_fakturoid_subject_data', 10, 3 );

[basepress-notice style=“info“]Vlastní funkce můžete vložit buď do tzv. child šablony nebo pomocí pluginu Code Snippets[/basepress-notice]