99 \
Magento\Framework\Locale\CurrencyInterface $localeCurrency,
103 $this->_directoryHelper = $directoryHelper;
106 $this->_groupManagement = $groupManagement;
108 $this->_localeCurrency = $localeCurrency;
109 parent::__construct($context,
$data);
119 return $this->_coreRegistry->registry(
'product');
166 if (is_array(
$data)) {
170 $currency = $this->_localeCurrency->getCurrency($this->_directoryHelper->getBaseCurrencyCode());
177 $currency->toCurrency(
$value[
'price'], [
'display' => \
Magento\Framework\Currency::NO_SYMBOL]);
200 public function getCustomerGroups(
$groupId =
null)
202 if ($this->_customerGroups ===
null) {
203 if (!$this->moduleManager->isEnabled(
'Magento_Customer')) {
208 $groups = $this->_groupRepository->getList($this->_searchCriteriaBuilder->create());
209 foreach ($groups->getItems() as
$group) {
210 $this->_customerGroups[
$group->getId()] =
$group->getCode();
215 return isset($this->_customerGroups[
$groupId]) ? $this->_customerGroups[
$groupId] : [];
238 return count($this->getWebsites());
248 return !$this->_storeManager->isSingleStoreMode();
256 public function getWebsites()
258 if ($this->_websites !==
null) {
263 0 => [
'name' =>
__(
'All Websites'),
'currency' => $this->_directoryHelper->getBaseCurrencyCode()]
268 $website = $this->_storeManager->getStore($this->
getProduct()->getStoreId())->getWebsite();
270 $this->_websites[
$website->getId()] = [
272 'currency' =>
$website->getBaseCurrencyCode()
275 $websites = $this->_storeManager->getWebsites();
276 $productWebsiteIds = $this->
getProduct()->getWebsiteIds();
279 if (!in_array(
$website->getId(), $productWebsiteIds)) {
282 $this->_websites[
$website->getId()] = [
284 'currency' =>
$website->getBaseCurrencyCode()
299 return $this->_groupManagement->getAllCustomersGroup()->getId();
310 return $this->_storeManager->getStore($this->
getProduct()->getStoreId())->getWebsiteId();
333 if ($this->
hasData(
'price_column_header')) {
334 return $this->
getData(
'price_column_header');
348 if ($this->
hasData(
'price_validation')) {
349 return $this->
getData(
'price_validation');
362 return $this->
getElement()->getEntityAttribute();
382 if ($this->
isScopeGlobal() || $this->_storeManager->isSingleStoreMode()) {
getData($key='', $index=null)
elseif(isset( $params[ 'redirect_parent']))
render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
getPriceColumnHeader($default)
__construct(\Magento\Backend\Block\Template\Context $context, GroupRepositoryInterface $groupRepository, \Magento\Directory\Helper\Data $directoryHelper, \Magento\Framework\Module\Manager $moduleManager, \Magento\Framework\Registry $registry, GroupManagementInterface $groupManagement, \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, \Magento\Framework\Locale\CurrencyInterface $localeCurrency, array $data=[])
setElement(\Magento\Framework\Data\Form\Element\AbstractElement $element)
_getInitialCustomerGroups()
getDefaultCustomerGroup()
getChildHtml($alias='', $useCache=true)
getPriceValidation($default)