/** * @return string */ public function prepareTaxClass() { $taxRulesGroups = TaxRulesGroupCore::getTaxRulesGroups(true); $idTaxRulesGroup = (int) Product::getIdTaxRulesGroupByIdProduct($this->currentProduct->id, null); foreach ($taxRulesGroups as $taxRulesGroup) { if ($taxRulesGroup['id_tax_rules_group'] == $idTaxRulesGroup) { $tax = ShopgateSettings::getTaxItemByTaxRuleGroupId($idTaxRulesGroup); $taxClassName = ''; if (is_array($tax->name) && !empty($tax->name[$this->getPlugin()->getLanguageId()])) { $taxClassName = $tax->name[$this->getPlugin()->getLanguageId()]; } else { if (is_array($tax->name)) { // fallback: just in case for older Prestashop versions $taxClassName = reset($tax->name); } } return $taxClassName; } } return ''; }
/** * Get all Tax Rules Groups * * @param bool $only_active * * @return array TaxRulesGroup */ public function getTaxRulesGroups($only_active = true) { return \TaxRulesGroupCore::getTaxRulesGroups($only_active); }