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

100.1.1 2024-04-19 08:15 UTC

This package is auto-updated.

Last update: 2024-11-19 09:37:13 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();