You are here

protected function ProductVariationFieldRenderer::buildAjaxReplacementClass in Commerce Core 8.2

Builds the AJAX replacement CSS class for a variation's field.

Parameters

string $field_name: The field name.

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

Return value

string The CSS class.

1 call to ProductVariationFieldRenderer::buildAjaxReplacementClass()
ProductVariationFieldRenderer::prepareForAjax in modules/product/src/ProductVariationFieldRenderer.php
Prepares the rendered field for AJAX replacement.

File

modules/product/src/ProductVariationFieldRenderer.php, line 116

Class

ProductVariationFieldRenderer

Namespace

Drupal\commerce_product

Code

protected function buildAjaxReplacementClass($field_name, ProductVariationInterface $variation) {
  return 'product--variation-field--variation_' . $field_name . '__' . $variation
    ->getProductId();
}