Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CheckoutTotalsJsLayoutDataProvider.php
Go to the documentation of this file.
1 <?php
8 
10 
15 {
19  protected $taxConfig;
20 
24  public function __construct(
25  \Magento\Tax\Model\Config $taxConfig
26  ) {
27  $this->taxConfig = $taxConfig;
28  }
29 
33  public function getData()
34  {
35  return [
36  'components' => [
37  'minicart_content' => [
38  'children' => [
39  'subtotal.container' => [
40  'children' => [
41  'subtotal' => [
42  'children' => [
43  'subtotal.totals' => [
44  'config' => $this->getTotalsConfig(),
45  ],
46  ],
47  ],
48  ],
49  ],
50  ],
51  ],
52  ],
53  ];
54  }
55 
61  protected function getTotalsConfig()
62  {
63  return [
64  'display_cart_subtotal_incl_tax' => (int)$this->taxConfig->displayCartSubtotalInclTax(),
65  'display_cart_subtotal_excl_tax' => (int)$this->taxConfig->displayCartSubtotalExclTax(),
66  ];
67  }
68 }