Quantcast
Channel: Shopware 5 - Shopware Community Forum
Viewing all articles
Browse latest Browse all 274

Article Count for every category in sidebar of listing/category page

$
0
0

Hello Guys,

I am new to Shopware, developing plugin to get the article count of a particular category and display in the listing/category page beside the category name in side bar, I have written the below code in Bootstrap.php of my plugin but I am getting only the parent ID of category.

 


        
    /** @var \Enlight_Controller_Action $controller */
             
       
        $request = $args->getSubject()->Request();
        $response = $args->getSubject()->Response();
        $view = $args->getSubject()->View();
        $parent = Shopware()->Shop()->get('parentID');
        $categoryId = $args->getRequest()->getParam('sCategory');
        $view->assign('id',$categoryId);
        $view->addTemplateDir(__DIR__ . '/Views/responsive');


Kindly reply with the solution to get ID of each category.


Viewing all articles
Browse latest Browse all 274


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>