Last active
May 23, 2016 17:45
-
-
Save wlwwt/7231f17ccfd43eeb76863b895d8eed7f to your computer and use it in GitHub Desktop.
Override mage2 core class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" ?> | |
<config> | |
<preference for="Magento\Catalog\Block\Adminhtml\Product\Edit\Tabs" type="Namespace\Spareparts\Block\Adminhtml\Product\Edit\Tabs" /> | |
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Copyright © 2016 Magento. All rights reserved. | |
* See COPYING.txt for license details. | |
*/ | |
namespace Namespace\Spareparts\Block\Adminhtml\Product\Edit; | |
/** | |
* Admin product edit tabs | |
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) | |
*/ | |
class Tabs extends \Magento\Catalog\Block\Adminhtml\Product\Edit\Tabs | |
{ | |
/** | |
* @return $this | |
* @SuppressWarnings(PHPMD.CyclomaticComplexity) | |
* @SuppressWarnings(PHPMD.NPathComplexity) | |
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) | |
*/ | |
protected function _prepareLayout() | |
{ | |
$this->addTab( | |
'spareparts', | |
[ | |
'label' => __('Spareparts'), | |
'url' => $this->getUrl('catalog/*/spareparts', ['_current' => true]), | |
'class' => 'ajax', | |
'group_code' => self::ADVANCED_TAB_GROUP_CODE | |
] | |
); | |
parent::_prepareLayout(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment