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)1322PHPPHP ^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 today

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 26% 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

807d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/56179468?v=4)[Angel Miranda](/maintainers/pixeldev)[@pixeldev](https://github.com/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

[mollie/magento2

Mollie Payment Module for Magento 2

1131.9M16](/packages/mollie-magento2)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68357.9k](/packages/run-as-root-magento2-prometheus-exporter)[opengento/module-category-import-export

This module add the capability to import and export the categories from the back-office.

1310.9k2](/packages/opengento-module-category-import-export)[buckaroo/magento2

Buckaroo Magento 2 extension

32420.3k8](/packages/buckaroo-magento2)[graycore/magento2-graphql-introspection-cache

1017.3k](/packages/graycore-magento2-graphql-introspection-cache)[loki/magento2-admin-components

Admin Panel grids and forms created via Loki Components

175.2k7](/packages/loki-magento2-admin-components)

PHPackages © 2026

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