13 class Collector extends \Magento\Sales\Model\Config\Ordered
87 $this->_scopeConfig = $scopeConfig;
88 $this->_totalFactory = $totalFactory;
89 parent::__construct($configCacheType,
$logger, $salesConfig, $sourceData,
$serializer);
91 $this->
_initModels()->_initCollectors()->_initRetrievers();
127 throw new \Magento\Framework\Exception\LocalizedException(
129 'The address total model should be extended from 130 \Magento\Quote\Model\Quote\Address\Total\AbstractTotal.' 135 $model->setCode($totalCode);
137 $this->_modelsConfig[$totalCode] =
$model->processConfigArray($this->_modelsConfig[$totalCode], $this->_store);
148 private function _initRetrievers()
150 $sorts = $this->_scopeConfig->getValue(
151 self::XML_PATH_SALES_TOTALS_SORT,
155 foreach ($sorts as
$code => $sortOrder) {
156 if (isset($this->_models[
$code])) {
158 $retrieverId = 100 * (int)$sortOrder;
160 while (isset($this->_retrievers[$retrieverId])) {
163 $this->_retrievers[$retrieverId] = $this->_models[
$code];
166 ksort($this->_retrievers);
167 $notSorted = array_diff(array_keys($this->_models), array_keys($sorts));
168 foreach ($notSorted as
$code) {
169 $this->_retrievers[] = $this->_models[
$code];
__construct(\Magento\Framework\App\Cache\Type\Config $configCacheType, \Psr\Log\LoggerInterface $logger, \Magento\Sales\Model\Config $salesConfig, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Quote\Model\Quote\Address\TotalFactory $totalFactory, $sourceData=null, $store=null, SerializerInterface $serializer=null)
_prepareConfigArray($code, $totalConfig)
const XML_PATH_SALES_TOTALS_SORT
$_option $_optionId $class
_initModelInstance($class, $totalCode, $totalConfig)