src/OpenCart/Invoice/Creator.php
protected function getVatRateLookupByTotalLineType($code)
    {
        $result = array();
        $query = $this->getTotalLineTaxClassLookupQuery($code);
        $queryResult = $this->getRegistry()->db->query($query);
        if (!empty($queryResult->row)) {
            $taxClassId = reset($queryResult->row);
            $result = $this->getVatRateLookupMetadata($taxClassId);
        }
        return $result;
    }
protected function getVatRateLookupByTotalLineType($code)
    {
        $result = array();
        $query = $this->getTotalLineTaxClassLookupQuery($code);
        $queryResult = $this->getRegistry()->db->query($query);
        if (!empty($queryResult->row)) {
            $taxClassId = reset($queryResult->row);
            $result = $this->getVatRateLookupMetadata($taxClassId);
        }
        return $result;
    }
protected function getVatRateLookupByTotalLineType ( $ code ) { $ result = array ( ) ; $ query = $ this -> getTotalLineTaxClassLookupQuery ( $ code ) ; $ queryResult = $ this -> getRegistry ( ) -> db -> query ( $ query ) ; if ( ! empty ( $ queryResult -> row ) ) { $ taxClassId = reset ( $ queryResult -> row ) ; $ result = $ this -> getVatRateLookupMetadata ( $ taxClassId ) ; } return $ result ; }
Tries to lookup and return vat rate meta data for the given line type.

This is quite hard. The total line (table order_total) contains a code
(= line type) and title field, the latter being a translated and possibly
formatted descriptive string of the shipping or handling method applied,
e.g. Europa  (Weight: 3.00kg). It is (almost) impossible to trace this
back to a shipping or handling method. So instead we retrieve all tax
class ids for the given type, collect all tax rates for those, and hope
that this results in only 1 tax rate.

@param string $code
The total line type: shipping, handling, low_order_fee, ... (no other
known types).

@return array
A, possibly empty, array with vat rate lookup meta data. Empty if no or
multiple tax rates were found.

@throws \Exception
Tries to lookup and return vat rate meta data for the given line type .