Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-swatches
Model
Plugin
Product.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Swatches\Model\Plugin
;
7
11
class
Product
12
{
20
public
function
afterGetMediaAttributes
(\
Magento
\Catalog\Model\
Product
$product
, $imageRoles)
21
{
22
if
(
$product
->getTypeId() !== \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
23
&&
$product
->getTypeId() !== \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL
24
) {
25
if
(is_array($imageRoles)) {
26
unset($imageRoles[\
Magento
\Swatches\Model\
Swatch::SWATCH_IMAGE_NAME
]);
27
}
28
}
29
30
return
$imageRoles;
31
}
32
}
Magento\Swatches\Model\Plugin
Definition:
Configurable.php:6
Magento\Catalog\Model\Product
Definition:
Product.php:42
Magento
Magento\Swatches\Model\Swatch\SWATCH_IMAGE_NAME
const SWATCH_IMAGE_NAME
Definition:
Swatch.php:47
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\Swatches\Model\Plugin\Product\afterGetMediaAttributes
afterGetMediaAttributes(\Magento\Catalog\Model\Product $product, $imageRoles)
Definition:
Product.php:20