Italian (Italy)
Knowledge Base  >  Vik Appointments  >  Hook  >  Tasse  >  Caricamento Operatori

apply_filters_ref_array( 'vikappointments_load_tax_operators', bool $status, array &$operators )

Fires while fetching all the supported taxes operators.


Description

Trigger hook to allow external plugins to support custom operations.

New operations have to be appended to the given associative array. The key of the array is the unique ID of the operation, the value is a readable name to display.

All the registered operators will be reported within the Math Operation dropdown, under the management page of a new tax rule.

Here's a list of operators supported by default:

  • add - sums the tax amount to the total cost (also known as excluded taxes);
  • sub - subtracts the tax amount from the total cost;
  • vat - separates the tax amount from the total cost (also known as inclusive taxes).

Parameters

$status

(bool)  True on success, false otherwise.

&$operators

(array)  An array of operators.


Example

The example below adds support for a new operator that applies the VAT only to European customers that do not have a valid VAT Number.

/** 
 * Trigger hook to allow external plugins to support custom operations.
 * New operations have to be appended to the given associative array.
 * The key of the array is the unique ID of the operation, the value is
 * a readable name to display.
 *
 * @param  boolean  $status      True on success, false otherwise.
 * @param  array    &$operators  An array of supported operators.
 */
add_filter('vikappointments_load_tax_operators', function($status, &$operators)
{
    // the key is the operator alias, the value is the name that appears within the dropdown.
    $operators['euvat'] = 'European VAT';

    return $status;
}, 10, 2);

Changelog

Version Description
1.2 Introduced.
Ultimo aggiornamento: 2021-08-18
Utile?
Potrebbe interessarti:

Questo sito web utilizza i cookie

Questo sito web utilizza cookie e tecnologie simili. Alcune di queste tecnologie sono necessarie per il corretto funzionamento del sito web (essenziali). Altre tecnologie sono utilizzate per valutare il comportamento degli utenti (analisi), per integrare media esterni o per scopi pubblicitari. Se l'utente accetta, queste tecnologie vengono attivate. I dettagli sono riportati nella Privacy Policy. Da questa stessa pagina è inoltre possibile aggiornare/revocare il consenso. Se non si fornisce il consenso, verranno attivati solo i cookie con funzioni essenziali.

Sul nostro sito web utilizziamo tecnologie provenienti dagli Stati Uniti. Pertanto, se acconsentite, acconsentite anche al trasferimento dei vostri dati negli Stati Uniti. Desideriamo sottolineare che gli Stati Uniti non hanno un livello di protezione dei dati paragonabile a quello dell'Unione Europea e che qualsiasi azienda statunitense può essere obbligata dalle autorità statali a consegnare i vostri dati senza che voi abbiate alcuno strumento efficace di protezione legale contro questo.