Back to PhocacartTax class

Method getTaxesByRegion

public static
getTaxesByRegion
(mixed $regionId)

Method getTaxesByRegion - Source code

// All taxes by region
public static function getTaxesByRegion($regionId)
{
    if ((int) $regionId > 0) {
        $db = Factory::getDBO();
        $q = 'SELECT t.id, t.title, t.ordering, t.tax_rate, tr.id as tcr_id, tr.title as tcr_title, tr.alias as tcr_alias, tr.tax_rate as tcr_tax_rate' . ' FROM #__phocacart_taxes as t' . ' LEFT JOIN #__phocacart_tax_regions AS tr ON tr.tax_id = t.id AND tr.region_id = ' . (int) $regionId . ' ORDER BY t.ordering ASC';
        $db->setQuery($q);
        $items = $db->loadObjectList();
        return $items;
    }
}