I want to show manufacturer in product list.

List of product need to be grouped on the basis of Manufacturer

Screen shot attachedsample

Here Pure Aero Bags and Pure Drive are Manufacturer


Firstly, you have to enable attribute visibility from backend to display in frontend and then, here is the code snippet I found to create the desired result.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$categoryobj = $objectManager->create('Magento\Catalog\Model\CategoryFactory');
$category = $categoryobj->create()->load($category->getId())->getProductCollection()->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)->addAttributeToSelect('*');

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.