Back to PhocacartTax class

Method getTaxIdsFromKey

public static
getTaxIdsFromKey
(mixed $taxKey)

Method getTaxIdsFromKey - Source code

public static function getTaxIdsFromKey($taxKey)
{
    $tax = array();
    $tax['id'] = 0;
    $tax['countryid'] = 0;
    $tax['regionid'] = 0;
    if ($taxKey != '') {
        $taxKeyA = explode(':', $taxKey);
        if (isset($taxKeyA[0])) {
            $tax['id'] = (int) $taxKeyA[0];
        }
        if (isset($taxKeyA[1])) {
            $tax['countryid'] = (int) $taxKeyA[1];
        }
        if (isset($taxKeyA[2])) {
            $tax['regionid'] = (int) $taxKeyA[2];
        }
    }
    return $tax;
}