PHPackages                             pixelopen/magento-product-main-category - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pixelopen/magento-product-main-category

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

pixelopen/magento-product-main-category
=======================================

The module adds a main category attribute to product

100.1.1(2y ago)1295PHPPHP ^8

Since Apr 19Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Pixel-Open/magento-product-main-category)[ Packagist](https://packagist.org/packages/pixelopen/magento-product-main-category)[ RSS](/packages/pixelopen-magento-product-main-category/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Magento Product Main Category
=============================

[](#magento-product-main-category)

[![Minimum PHP Version](https://camo.githubusercontent.com/ce4853f487ac82c0ad9f925ebf93810c21278dccb05579d177d9df4a154c9be8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e302d677265656e)](https://php.net/)[![Minimum Magento Version](https://camo.githubusercontent.com/4f1152f6fd3edddf6002af0689740bada090d1933458860034c72b8c32ba05a0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6167656e746f2d253345253344253230322e342e342d677265656e)](https://business.adobe.com/products/magento/magento-commerce.html)[![GitHub release](https://camo.githubusercontent.com/df1ceaae8e35d95acac83748a4aaaa9108b78fc95947bcfacaae7e31fca73910/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f506978656c2d4f70656e2f6d6167656e746f2d70726f647563742d6d61696e2d63617465676f7279)](https://github.com/Pixel-Open/magento-product-main-category/releases)

Presentation
------------

[](#presentation)

The module adds a main category attribute to product.

[![Product Main Category](screenshot.png)](screenshot.png)

Requirements
------------

[](#requirements)

- Magento &gt;= 2.4.4
- PHP &gt;= 8.0.0

Installation
------------

[](#installation)

```
composer require pixelopen/magento-product-main-category

```

Retrieve Product Main Category value
------------------------------------

[](#retrieve-product-main-category-value)

```
$mainCategory = $product->getMainCategory();

// OR

$mainCategory = $product->getData('main_category');

// OR

$mainCategory = $product->getCustomAttribute('main_category')?->getValue();
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2b87043ea111a9f5d76ffa990f48eea6e80576483c7bf33f0dcdd5a899c15c8?d=identicon)[pixeldev](/maintainers/pixeldev)

---

Top Contributors

[![magentix](https://avatars.githubusercontent.com/u/346889?v=4)](https://github.com/magentix "magentix (3 commits)")

### Embed Badge

![Health badge](/badges/pixelopen-magento-product-main-category/health.svg)

```
[![Health](https://phpackages.com/badges/pixelopen-magento-product-main-category/health.svg)](https://phpackages.com/packages/pixelopen-magento-product-main-category)
```

###  Alternatives

[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[swissup/module-search-mysql-legacy

Legacy mysql search for magento 2.4

10483.0k](/packages/swissup-module-search-mysql-legacy)[graycore/magento2-graphql-introspection-cache

1015.2k](/packages/graycore-magento2-graphql-introspection-cache)[trustpilot/module-reviews

The Trustpilot Review extension makes it simple and easy for merchants to collect reviews from their customers to power their marketing efforts, increase sales conversion, build their online reputation and draw business insights.

12886.7k](/packages/trustpilot-module-reviews)[elgentos/magento2-structured-data

Implement structured data for Magento 2 webshops.

1444.7k](/packages/elgentos-magento2-structured-data)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
