DefaultTotals.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Block\Adminhtml\Order\Create\Totals;
  7. use Magento\Framework\Pricing\PriceCurrencyInterface;
  8. /**
  9. * Default Total Row Renderer
  10. *
  11. * @author Magento Core Team <core@magentocommerce.com>
  12. */
  13. class DefaultTotals extends \Magento\Sales\Block\Adminhtml\Order\Create\Totals
  14. {
  15. /**
  16. * Template
  17. *
  18. * @var string
  19. */
  20. protected $_template = 'Magento_Sales::order/create/totals/default.phtml';
  21. /**
  22. * @var PriceCurrencyInterface
  23. */
  24. protected $priceCurrency;
  25. /**
  26. * Retrieve quote session object
  27. *
  28. * @return \Magento\Backend\Model\Session\Quote
  29. */
  30. protected function _getSession()
  31. {
  32. return $this->_sessionQuote;
  33. }
  34. /**
  35. * Retrieve store model object
  36. *
  37. * @return \Magento\Store\Model\Store
  38. */
  39. public function getStore()
  40. {
  41. return $this->_getSession()->getStore();
  42. }
  43. /**
  44. * Format price
  45. *
  46. * @param float $value
  47. * @return string
  48. */
  49. public function formatPrice($value)
  50. {
  51. return $this->priceCurrency->format(
  52. $value,
  53. true,
  54. PriceCurrencyInterface::DEFAULT_PRECISION,
  55. $this->getStore()
  56. );
  57. }
  58. }