interface TaxTypeInterface in Commerce Core 8.2
Same name in this branch
- 8.2 modules/tax/src/Entity/TaxTypeInterface.php \Drupal\commerce_tax\Entity\TaxTypeInterface
- 8.2 modules/tax/src/Plugin/Commerce/TaxType/TaxTypeInterface.php \Drupal\commerce_tax\Plugin\Commerce\TaxType\TaxTypeInterface
Defines the base interface for tax types.
Tax types can be local and remote, therefore each tax type plugin actually implements one of the child interfaces.
Hierarchy
- interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Component\Plugin\DependentPluginInterface; interface \Drupal\Core\Plugin\PluginFormInterface; interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\DerivativeInspectionInterface
- interface \Drupal\commerce_tax\Plugin\Commerce\TaxType\TaxTypeInterface
Expanded class hierarchy of TaxTypeInterface
All classes that implement TaxTypeInterface
See also
\Drupal\commerce_tax\Plugin\Commerce\TaxType\LocalTaxTypeInterface
\Drupal\commerce_tax\Plugin\Commerce\TaxType\RemoteTaxTypeInterface
File
- modules/
tax/ src/ Plugin/ Commerce/ TaxType/ TaxTypeInterface.php, line 21
Namespace
Drupal\commerce_tax\Plugin\Commerce\TaxTypeView source
interface TaxTypeInterface extends ConfigurableInterface, DependentPluginInterface, PluginFormInterface, PluginInspectionInterface, DerivativeInspectionInterface {
/**
* Gets the tax type label.
*
* @return string
* The tax type label.
*/
public function getLabel();
/**
* Gets the tax type weight.
*
* Used to determine the order in which tax type plugins should run.
*
* @return int
* The tax type weight.
*/
public function getWeight();
/**
* Gets whether the tax type is display inclusive.
*
* E.g. US sales tax is not display inclusive, a $5 price is shown as $5
* even if a $1 tax has been calculated. In France, a 5€ price is shown as
* 6€ if a 1€ tax was calculated, because French VAT is display inclusive.
*
* @return bool
* TRUE if the tax type is display inclusive, FALSE otherwise.
*/
public function isDisplayInclusive();
/**
* Checks whether the tax type applies to the given order.
*
* @param \Drupal\commerce_order\Entity\OrderInterface $order
* The order.
*
* @return bool
* TRUE if the tax type applies, FALSE otherwise.
*/
public function applies(OrderInterface $order);
/**
* Applies the tax type to the given order.
*
* Taxes should be added on the order item level, to make returns
* and refunds easier. This is true even for taxes that are only
* shown at the order level, such as sales taxes.
*
* @param \Drupal\commerce_order\Entity\OrderInterface $order
* The order.
*/
public function apply(OrderInterface $order);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableInterface:: |
public | function | Gets default configuration for this plugin. | 11 |
ConfigurableInterface:: |
public | function | Gets this plugin's configuration. | 12 |
ConfigurableInterface:: |
public | function | Sets the configuration for this plugin instance. | 12 |
DependentPluginInterface:: |
public | function | Calculates dependencies for the configured plugin. | 19 |
DerivativeInspectionInterface:: |
public | function | Gets the base_plugin_id of the plugin instance. | 1 |
DerivativeInspectionInterface:: |
public | function | Gets the derivative_id of the plugin instance. | 1 |
PluginFormInterface:: |
public | function | Form constructor. | 36 |
PluginFormInterface:: |
public | function | Form submission handler. | 32 |
PluginFormInterface:: |
public | function | Form validation handler. | 18 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |
TaxTypeInterface:: |
public | function | Checks whether the tax type applies to the given order. | 1 |
TaxTypeInterface:: |
public | function | Applies the tax type to the given order. | 1 |
TaxTypeInterface:: |
public | function | Gets the tax type label. | 1 |
TaxTypeInterface:: |
public | function | Gets the tax type weight. | 1 |
TaxTypeInterface:: |
public | function | Gets whether the tax type is display inclusive. | 1 |