pixelopen / magento-product-main-category
There is no license information available for the latest version (100.1.1) of this package.
The module adds a main category attribute to product
Package info
github.com/Pixel-Open/magento-product-main-category
Type:magento2-module
pkg:composer/pixelopen/magento-product-main-category
100.1.1
2024-04-19 08:15 UTC
Requires
- php: ^8
- magento/framework: *
- magento/module-catalog: *
- magento/module-eav: *
This package is auto-updated.
Last update: 2026-02-19 12:33:41 UTC
README
Presentation
The module adds a main category attribute to product.
Requirements
- Magento >= 2.4.4
- PHP >= 8.0.0
Installation
composer require pixelopen/magento-product-main-category
Retrieve Product Main Category value
$mainCategory = $product->getMainCategory(); // OR $mainCategory = $product->getData('main_category'); // OR $mainCategory = $product->getCustomAttribute('main_category')?->getValue();