I have created a custom Tab on the product details page. Now I want to show the count of those articles, like how Reviews count are shown in tab title.

     <argument translate="true" name="title" xsi:type="string">Frequently Asked Questions</argument>

This is the code used to show the tab. Now how can I show the count.

I have tried to use the Class in my block class like -

use \Magento\Framework\DataObject\IdentityInterface as IdentityInterface;
use \Magento\Framework\View\Element\Template as Template;
class Customtab extends Template implements IdentityInterface

and then -

public function setTabTitle()
        $title = 'Frequently Asked Questions';

But it is giving -

Fatal error: Class Vendor\Module\Block\Product\View\Details\Customtab contains 1 abstract method and must therefore be declared abstract or implement the remaining methods


It was done. All I needed was to add -


in the construct

And use setTabTitle function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.