Magento 2 Smart Product Tabs DocumentationSmart Product Tabs

« Back to Magento 2 Smart Product Tabs

Table of Contents
  1. Installation
  2. Tabs Ordering
Need Help?

info@fishpig.com

 
  • Installation

    You can install the module for Magento 2 using Composer or you can manually install it using FTP.

    • Run the following commands in your Magento 2 root directory to install the module using Composer.

      # Add the FishPig Composer repo
      composer config repositories.fishpig composer https://repo.fishpig.co.uk/
          
      # Install the module using Composer
      composer require fishpig/fishpig/magento2-smarttabs:*
      
      # Enable the module in Magento 2
      php bin/magento module:enable FishPig_SmartProductTabs
      
      # Run the Magento upgrade system
      php bin/magento setup:upgrade
    • You can download the latest version of the module from the Downloads page.

      Extract the ZIP file and upload the files to your Magento site at the directory below:

      app/code/FishPig/SmartProductTabs

      When creating the folders, ensure you use the correct capitalisation.

      To complete the installation, run the following commands in a terminal.

      # Enable the module in Magento 2
      php bin/magento module:enable FishPig_SmartProductTabs
      
      # Run the Magento upgrade system
      php bin/magento setup:upgrade

    ↑ Back to Top

  • Tabs Ordering

    It is now possible to display smart tabs and non-smart tabs (ie. tabs added by layout XML in your theme) in a mixed order. You no longer have to choose between having Smart Tabs as the first tabs or last tabs. To do this, ensure your theme uses the getGroupSortedChildNames method.

    // The correct way using getGroupSortedChildNames
    $detailedInfoGroup = $block->getGroupSortedChildNames('detailed_info', 'getChildHtml');
    
    // The incorrect way using getGroupChildNames
    // This will just add the Smart Tabs at the end rather than using the sort_order
    $detailedInfoGroup = $block->getGroupChildNames('detailed_info', 'getChildHtml');

    This would usually be in the Magento_Catalog::product/view/details.phtml template but it may be different in your theme.

    ↑ Back to Top