15 \Magento\Framework\Data\Form\Element\Renderer\RendererInterface
35 protected $_template =
'Magento_Weee::renderer/tax.phtml';
63 \
Magento\Directory\Model\Config\Source\Country $sourceCountry,
64 \
Magento\Directory\Helper\Data $directoryHelper,
68 $this->_sourceCountry = $sourceCountry;
69 $this->_directoryHelper = $directoryHelper;
71 parent::__construct($context,
$data);
79 return $this->_coreRegistry->registry(
'product');
99 \
Magento\Backend\Block\Widget\Button::class,
100 [
'label' =>
__(
'Add Tax'),
'data_attribute' => [
'action' =>
'add-fpt-item'],
'class' =>
'add']
104 \
Magento\Backend\Block\Widget\Button::class,
106 'label' =>
__(
'Delete Tax'),
107 'data_attribute' => [
'action' =>
'delete-fpt-item'],
111 return parent::_prepareLayout();
141 usort(
$data, [$this,
'_sortWeeeTaxes']);
154 if ($firstItem[
'website_id'] != $secondItem[
'website_id']) {
155 return $firstItem[
'website_id'] < $secondItem[
'website_id'] ? -1 : 1;
157 if ($firstItem[
'country'] != $secondItem[
'country']) {
158 return $firstItem[
'country'] < $secondItem[
'country'] ? -1 : 1;
176 return !$this->_storeManager->hasSingleStore();
184 if (
null === $this->_countries) {
185 $this->_countries = $this->_sourceCountry->toOptionArray();
196 if (
null !== $this->_websites) {
201 'name' =>
__(
'All Websites'),
202 'currency' => $this->_directoryHelper->getBaseCurrencyCode(),
205 if (!$this->_storeManager->hasSingleStore() && !$this->
getElement()->getEntityAttribute()->isScopeGlobal()) {
210 'currency' =>
$website->getConfig(\
Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE),
213 foreach ($this->_storeManager->getWebsites() as
$website) {
219 'currency' =>
$website->getConfig(\
Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE),
setElement(AbstractElement $element)
addChild($alias, $block, $data=[])
render(AbstractElement $element)
_sortWeeeTaxes($firstItem, $secondItem)
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\Directory\Model\Config\Source\Country $sourceCountry, \Magento\Directory\Helper\Data $directoryHelper, \Magento\Framework\Registry $registry, array $data=[])
getChildHtml($alias='', $useCache=true)