Hi i am trying to get product collection with category filter and category position sorting but it not working i tried below way

 $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->addCategoriesFilter(array('eq' => $category->getId()));//
        $collection->addAttributeToSort('position'); 
//->setOrder('cat_index_position','ASC')

please any one tell me how to sort category positon

没有正确的解决方案

许可以下: CC-BY-SA归因
scroll top