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

Maintainers

Package info

github.com/Pixel-Open/magento-product-main-category

Type:magento2-module

pkg:composer/pixelopen/magento-product-main-category

Statistics

Installs: 290

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

100.1.1 2024-04-19 08:15 UTC

This package is auto-updated.

Last update: 2026-02-19 12:33:41 UTC


README

Minimum PHP Version Minimum Magento Version GitHub release

Presentation

The module adds a main category attribute to product.

Product Main Category

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();