Skip to main content
added 55 characters in body
Source Link
Marius
  • 198.5k
  • 55
  • 424
  • 833

[EDIT] this does not work anymore for magento 2.1

you can create you own module.
In this module, create a file called view/adminhtml/layout/catalog_product_new.xml with this content

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product_tabs">
            <action method="addTabAfter">
                <argument name="tabId" xsi:type="string">tab-code-here</argument>
                <argument name="tab" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Tab label here</item>
                    <item name="class" xsi:type="string">ajax</item>
                    <item name="url" xsi:type="helper" helper="[Namespace]\[Module]\Helper\Url::getUrl" />
                    <item name="group_code" xsi:type="string">basic</item>
                </argument>
                <argument name="after" xsi:type="string">product-details</argument>
            </action>
        </referenceBlock>
    </body>
</page>

then create the file Helper/Url.php with this content:

<?php
namespace [Namespace]\[Module]\Helper;

class Url
{
    /**
     * @var \Magento\Framework\UrlInterface
     */
    protected $urlBuilder;

    /**
     * @param \Magento\Framework\UrlInterface $urlBuilder
     */
    public function __construct(
        \Magento\Framework\UrlInterface $urlBuilder
    )
    {
        $this->urlBuilder = $urlBuilder;
    }
    public function getUrl()
    {
        return $this->urlBuilder->getUrl('your_tab/url/here', ['_current' => true]);
    }
}

this will add the tab right after "Product Details" tab. To re-position it, play around with the parameters from the xml file.

you can create you own module.
In this module, create a file called view/adminhtml/layout/catalog_product_new.xml with this content

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product_tabs">
            <action method="addTabAfter">
                <argument name="tabId" xsi:type="string">tab-code-here</argument>
                <argument name="tab" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Tab label here</item>
                    <item name="class" xsi:type="string">ajax</item>
                    <item name="url" xsi:type="helper" helper="[Namespace]\[Module]\Helper\Url::getUrl" />
                    <item name="group_code" xsi:type="string">basic</item>
                </argument>
                <argument name="after" xsi:type="string">product-details</argument>
            </action>
        </referenceBlock>
    </body>
</page>

then create the file Helper/Url.php with this content:

<?php
namespace [Namespace]\[Module]\Helper;

class Url
{
    /**
     * @var \Magento\Framework\UrlInterface
     */
    protected $urlBuilder;

    /**
     * @param \Magento\Framework\UrlInterface $urlBuilder
     */
    public function __construct(
        \Magento\Framework\UrlInterface $urlBuilder
    )
    {
        $this->urlBuilder = $urlBuilder;
    }
    public function getUrl()
    {
        return $this->urlBuilder->getUrl('your_tab/url/here', ['_current' => true]);
    }
}

this will add the tab right after "Product Details" tab. To re-position it, play around with the parameters from the xml file.

[EDIT] this does not work anymore for magento 2.1

you can create you own module.
In this module, create a file called view/adminhtml/layout/catalog_product_new.xml with this content

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product_tabs">
            <action method="addTabAfter">
                <argument name="tabId" xsi:type="string">tab-code-here</argument>
                <argument name="tab" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Tab label here</item>
                    <item name="class" xsi:type="string">ajax</item>
                    <item name="url" xsi:type="helper" helper="[Namespace]\[Module]\Helper\Url::getUrl" />
                    <item name="group_code" xsi:type="string">basic</item>
                </argument>
                <argument name="after" xsi:type="string">product-details</argument>
            </action>
        </referenceBlock>
    </body>
</page>

then create the file Helper/Url.php with this content:

<?php
namespace [Namespace]\[Module]\Helper;

class Url
{
    /**
     * @var \Magento\Framework\UrlInterface
     */
    protected $urlBuilder;

    /**
     * @param \Magento\Framework\UrlInterface $urlBuilder
     */
    public function __construct(
        \Magento\Framework\UrlInterface $urlBuilder
    )
    {
        $this->urlBuilder = $urlBuilder;
    }
    public function getUrl()
    {
        return $this->urlBuilder->getUrl('your_tab/url/here', ['_current' => true]);
    }
}

this will add the tab right after "Product Details" tab. To re-position it, play around with the parameters from the xml file.

Source Link
Marius
  • 198.5k
  • 55
  • 424
  • 833

you can create you own module.
In this module, create a file called view/adminhtml/layout/catalog_product_new.xml with this content

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product_tabs">
            <action method="addTabAfter">
                <argument name="tabId" xsi:type="string">tab-code-here</argument>
                <argument name="tab" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Tab label here</item>
                    <item name="class" xsi:type="string">ajax</item>
                    <item name="url" xsi:type="helper" helper="[Namespace]\[Module]\Helper\Url::getUrl" />
                    <item name="group_code" xsi:type="string">basic</item>
                </argument>
                <argument name="after" xsi:type="string">product-details</argument>
            </action>
        </referenceBlock>
    </body>
</page>

then create the file Helper/Url.php with this content:

<?php
namespace [Namespace]\[Module]\Helper;

class Url
{
    /**
     * @var \Magento\Framework\UrlInterface
     */
    protected $urlBuilder;

    /**
     * @param \Magento\Framework\UrlInterface $urlBuilder
     */
    public function __construct(
        \Magento\Framework\UrlInterface $urlBuilder
    )
    {
        $this->urlBuilder = $urlBuilder;
    }
    public function getUrl()
    {
        return $this->urlBuilder->getUrl('your_tab/url/here', ['_current' => true]);
    }
}

this will add the tab right after "Product Details" tab. To re-position it, play around with the parameters from the xml file.