pixelopen / magento-product-main-category
The module adds a main category attribute to product
Installs: 92
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- php: ^8
- magento/framework: *
- magento/module-catalog: *
- magento/module-eav: *
This package is auto-updated.
Last update: 2024-10-19 09:29:38 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();