Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractTotalsProcessor.php
Go to the documentation of this file.
1 <?php
7 
9 
20 {
26  protected $scopeConfig;
27 
32  public function __construct(
34  ) {
35  $this->scopeConfig = $scopeConfig;
36  }
37 
42  public function sortTotals($totals)
43  {
44  $configData = $this->scopeConfig->getValue('sales/totals_sort');
45  foreach ($totals as $code => &$total) {
46  //convert JS naming style to config naming style
47  $code = str_replace('-', '_', $code);
48  if (array_key_exists($code, $configData)) {
49  $total['sortOrder'] = $configData[$code];
50  }
51  }
52 
53  return $totals;
54  }
55 }
$totals
Definition: totalbar.phtml:10
$code
Definition: info.phtml:12