Cart_VAT implements Registerable, Service
Stores the current state of VAT in the EDD cart.
Tags
Interfaces, Classes and Traits
- Registerable
- Service
Table of Contents
- SESSION_KEY = 'vat'
- $is_reverse_charged : bool
- Whether the VAT is reverse charged in the cart.
- $vat_details : VAT_Check_Result
- The current VAT information.
- check_billing_country() : mixed
- Check if the billing country matches the saved VAT details and clear if not.
- check_vat_number() : mixed
- Checks a VAT number
- clear() : mixed
- Clear the VAT check from the cart session.
- get_vat_details() : VAT_Check_Result
- Returns the VAT details result
- is_reverse_charged() : bool
- Check whether the VAT has been reverse charged.
- register() : mixed
- {@inheritdoc}
- restore() : mixed
- Applies the VAT details if a cart is restored
- save() : mixed
- Saves the VAT check to the cart session.
Constants
SESSION_KEY
public
mixed
SESSION_KEY
= 'vat'
Properties
$is_reverse_charged
Whether the VAT is reverse charged in the cart.
private
bool
$is_reverse_charged
= false
$vat_details
The current VAT information.
private
VAT_Check_Result
$vat_details
Methods
check_billing_country()
Check if the billing country matches the saved VAT details and clear if not.
public
check_billing_country() : mixed
Return values
mixed —check_vat_number()
Checks a VAT number
public
check_vat_number(string $vat_number, string $country_code) : mixed
Parameters
- $vat_number : string
- $country_code : string
Return values
mixed —clear()
Clear the VAT check from the cart session.
public
clear() : mixed
Return values
mixed —get_vat_details()
Returns the VAT details result
public
get_vat_details() : VAT_Check_Result
Return values
VAT_Check_Result —is_reverse_charged()
Check whether the VAT has been reverse charged.
public
is_reverse_charged() : bool
Return values
bool —register()
{@inheritdoc}
public
register() : mixed
Return values
mixed —restore()
Applies the VAT details if a cart is restored
public
restore(EDD_Cart $cart) : mixed
Parameters
- $cart : EDD_Cart
Return values
mixed —save()
Saves the VAT check to the cart session.
public
save() : mixed