Product Tabs in Admin Panel

Hi,
I want to show features and shipping properties tabs when creating a product in admin panel as well vendor panel. For now, these tabs are only visible once the product is created.
Any guidance will be helpful
Thank you

Anyone with some ideas would be appreciated.
Thank you.

Product features depend on categories. Since the product category is not defined, you do not see list of available product features

1 Like

Hi,
The Features tab is working as fine but now Iam facing a problem with Variation tab. Added the follwoing code in app/addons/my_changes/controllers/backend/product.post.php

if ($mode === ‘add’) {

Registry::set('navigation.tabs', [

    'detailed' => [
        'title' => __('general'),
        'js'    => true
    ],
    'shippings' => [
        'title' => __('shipping_properties'),
        'js'    => true
    ],
    'options' => [
        'title' => __('options'),
        'js'    => true
    ],
    'features' => [
        'title' => __('features'),
        'js'    => true
    ],
    
    'variations' => [
        'title' => __('product_variations.variations'),
        'js'    => true
    ], 
    'seo' => [
        'title' => __('seo'),
        'js'    => true
    ],
    'qty_discounts' => [
        'title' => __('qty_discounts'),
        'js'    => true
    ],
    'tags' => [
        'title' => __('tags'),
        'js'    => true
    ],
    'addons' => [
        'title' => __('addons'),
        'js'    => true
    ],
]);

}
All other are working fine but the variation tab is blank, why is it like this?
Is logic incorrect, or are there other issues?

You have created PHP code only. now you will need to create .tpl files depend on hooks as well.

1 Like

No need to refill the navigation tabs with hard code in the add-on. In case you need to add new tab in a some custom controller, you can use the post controller with similar code:

$tabs = Registry::get('navigation.tabs');
if (!in_array('features', $tabs)) {
    $tabs['features'] = [...];
}
Registry::set('navigation.tabs', $tabs);

As for the empty variations, make sure that your add-on adds the div with id="content_variations" to the product details page. By default its content is loaded by AJAX, from this one template: design/backend/templates/addons/product_variations/views/product_variations/manage.tpl:

'variations' => [
    'title' => __('product_variations.variations'),
    'href'  => 'product_variations.manage?product_id=' . $product_data['product_id'],
    'ajax'  => true
]
1 Like