Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Static Public Member Functions | Static Private Member Functions | List of all members
eZDefaultVATHandler Class Reference

Default VAT handler. More...

## Static Public Member Functions
| getVatPercent ( $object, $country)

## Static Private Member Functions
| getProductCategory ( $object)
| chooseVatType ( $productCategory, $country)

## Detailed Description

Default VAT handler.

Provides basic VAT charging rules. Resulting VAT percentage may depend on product category and country the user is from.

Definition at line 20 of file ezdefaultvathandler.php.

## Member Function Documentation

## ◆ chooseVatType()

eZDefaultVATHandler::chooseVatType | ( |  | $productCategory,
|  |  | $country
| ) |  |
| static private

Choose the best matching VAT type for given product category and country.

We calculate priority for each VAT type and then choose the VAT type having the highest priority (or first of those having the highest priority).

VAT type priority is calculated from county match and category match as following:

CountryMatch = 0 CategoryMatch = 1

if ( there is exact match on country ) CountryMatch = 2 elseif ( there is weak match on country ) CountryMatch = 1

if ( there is exact match on product category ) CategoryMatch = 2 elseif ( there is weak match on product category ) CategoryMatch = 1

if ( there is match on both country and category ) VatTypePriority = CountryMatch * 2 + CategoryMatch - 2 else VatTypePriority = 0

Definition at line 134 of file ezdefaultvathandler.php.

References eZVatType\fetch(), eZVatRule\fetchList(), ezpI18n\tr(), eZDebug\writeDebug(), and eZDebug\writeError().

Referenced by getVatPercent().

## ◆ getProductCategory()

eZDefaultVATHandler::getProductCategory | ( |  | $object | ) |
| static private

Determine object's product category.

Definition at line 58 of file ezdefaultvathandler.php.

References eZDebug\writeError(), and eZDebug\writeNotice().

Referenced by getVatPercent().

## ◆ getVatPercent()

eZDefaultVATHandler::getVatPercent | ( |  | $object,
|  |  | $country
| ) |  |
| static

Definition at line 26 of file ezdefaultvathandler.php.

References chooseVatType(), and getProductCategory().

The documentation for this class was generated from the following file:

- ezdefaultvathandler.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.