You are here

public function ProductVariationAttributeMapperInterface::prepareAttributes in Commerce Core 8.2

Prepares the available attributes for the selected product variation.

The attribute and its values are retrieved in the language of the variation. Values not corresponding to any variation are removed.

Parameters

\Drupal\commerce_product\Entity\ProductVariationInterface $selected_variation: The selected product variation.

\Drupal\commerce_product\Entity\ProductVariationInterface[] $variations: The available product variations.

Return value

\Drupal\commerce_product\PreparedAttribute[] The prepared attributes, keyed by field name.

1 method overrides ProductVariationAttributeMapperInterface::prepareAttributes()
ProductVariationAttributeMapper::prepareAttributes in modules/product/src/ProductVariationAttributeMapper.php
Prepares the available attributes for the selected product variation.

File

modules/product/src/ProductVariationAttributeMapperInterface.php, line 48

Class

ProductVariationAttributeMapperInterface
Provides logic for selecting variations using attributes.

Namespace

Drupal\commerce_product

Code

public function prepareAttributes(ProductVariationInterface $selected_variation, array $variations);