52 $this->taxRateRepository = $rateService;
59 public function loadData($printQuery =
false, $logQuery =
false)
64 $this->_totalRecords = $searchResults->getTotalCount();
65 foreach ($searchResults->getItems() as
$taxRate) {
81 $collectionItem = new \Magento\Framework\DataObject();
82 $collectionItem->setTaxCalculationRateId(
$taxRate->getId());
83 $collectionItem->setCode(
$taxRate->getCode());
84 $collectionItem->setTaxCountryId(
$taxRate->getTaxCountryId());
85 $collectionItem->setTaxRegionId(
$taxRate->getTaxRegionId());
86 $collectionItem->setRegionName(
$taxRate->getRegionName());
87 $collectionItem->setTaxPostcode(
$taxRate->getTaxPostcode());
88 $collectionItem->setRate(
$taxRate->getRate());
89 $collectionItem->setTitles($this->rateConverter->createTitleArrayFromServiceObject(
$taxRate));
93 $collectionItem->setZipIsRange(
"1");
94 $collectionItem->setZipFrom(
$taxRate->getZipFrom());
95 $collectionItem->setZipTo(
$taxRate->getZipTo());
97 $collectionItem->setZipIsRange(
null);
98 $collectionItem->setZipFrom(
null);
99 $collectionItem->setZipTo(
null);
102 return $collectionItem;
createTaxRateCollectionItem(TaxRate $taxRate)
loadData($printQuery=false, $logQuery=false)
__construct(EntityFactory $entityFactory, FilterBuilder $filterBuilder, SearchCriteriaBuilder $searchCriteriaBuilder, SortOrderBuilder $sortOrderBuilder, TaxRateRepositoryInterface $rateService, \Magento\Tax\Model\Calculation\Rate\Converter $rateConverter)