![]() 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/Ecombricks/InventoryInventoryCatalogTax/Plugin/Model/Product/ |
<?php /** * Copyright © eComBricks. All rights reserved. * See COPYING.txt for license details. */ namespace Ecombricks\InventoryInventoryCatalogTax\Plugin\Model\Product; /** * Product source item tax class model plugin */ class SourceItemTaxClass extends \Ecombricks\InventoryInventoryCatalog\Plugin\Model\Product\SourceItemOption { /** * Constructor * * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\InventoryConfigurationApi\Model\IsSourceItemManagementAllowedForProductTypeInterface $isSourceItemManagementAllowedForProductType * @param \Ecombricks\Inventory\Model\SourceManagement $sourceManagement * @param \Ecombricks\InventoryInventoryCatalogTax\Model\SourceItemTaxClass\Get $getSourceItemOptions * @param \Ecombricks\InventoryInventoryCatalogTax\Model\SourceItemTaxClass\ValueDataKey $sourceItemOptionValueDataKey * @param \Ecombricks\InventoryInventoryCatalogTax\Model\SourceItemTaxClass\Config $sourceItemOptionConfig * @return void */ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\InventoryConfigurationApi\Model\IsSourceItemManagementAllowedForProductTypeInterface $isSourceItemManagementAllowedForProductType, \Ecombricks\Inventory\Model\SourceManagement $sourceManagement, \Ecombricks\InventoryInventoryCatalogTax\Model\SourceItemTaxClass\Get $getSourceItemOptions, \Ecombricks\InventoryInventoryCatalogTax\Model\SourceItemTaxClass\ValueDataKey $sourceItemOptionValueDataKey, \Ecombricks\InventoryInventoryCatalogTax\Model\SourceItemTaxClass\Config $sourceItemOptionConfig ) { parent::__construct( $storeManager, $isSourceItemManagementAllowedForProductType, $sourceManagement, $getSourceItemOptions, $sourceItemOptionValueDataKey, $sourceItemOptionConfig ); } /** * Around get data * * @param \Magento\Catalog\Model\Product $subject * @param callable $proceed * @param string $key * @param string|int $index * @return mixed */ public function aroundGetData( \Magento\Catalog\Model\Product $subject, \Closure $proceed, $key = '', $index = null ) { $value = $proceed($key, $index); if ($key !== $this->sourceItemOptionValueDataKey->getKey()) { return $value; } return $this->getSourceItemOptionValue($subject, $value); } }