![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-reports/Block/Adminhtml/Grid/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Reports\Block\Adminhtml\Grid; /** * Adminhtml shopping carts report grid block * * @author Magento Core Team <[email protected]> */ class Shopcart extends \Magento\Backend\Block\Widget\Grid\Extended { /** * Stores current currency code * * @var array */ protected $_currentCurrencyCode = null; /** * Ids of current stores * * @var array */ protected $_storeIds = []; /** * StoreIds setter * * @codeCoverageIgnore * * @param array $storeIds * @return $this */ public function setStoreIds($storeIds) { $this->_storeIds = $storeIds; return $this; } /** * Retrieve currency code based on selected store * * @return string */ public function getCurrentCurrencyCode() { if (empty($this->_storeIds)) { $this->setStoreIds(array_keys($this->_storeManager->getStores())); } if ($this->_currentCurrencyCode === null) { reset($this->_storeIds); $this->_currentCurrencyCode = count( $this->_storeIds ) > 0 ? $this->_storeManager->getStore( current($this->_storeIds) )->getBaseCurrencyCode() : $this->_storeManager->getStore()->getBaseCurrencyCode(); } return $this->_currentCurrencyCode; } /** * Get currency rate (base to given currency) * * @param string|\Magento\Directory\Model\Currency $toCurrency * @return float */ public function getRate($toCurrency) { return $this->_storeManager->getStore()->getBaseCurrency()->getRate($toCurrency); } }