You are here

public static function BulkVariationsCreator::getSkuwidget in Commerce Bulk 8

Helper method to get variation sku field form display settings.

Parameters

\Drupal\commerce_product\Entity\ProductVariation $variation: The commerce product variation.

Return value

\Drupal\commerce_product\Plugin\Field\FieldWidget\ProductVariationSkuWidget The product variation SKU widget.

Overrides BulkVariationsCreatorInterface::getSkuwidget

See also

\Drupal\commerce\Plugin\Field\FieldWidget\ProductVariationSkuWidget

\Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextfieldWidget

1 call to BulkVariationsCreator::getSkuwidget()
BulkVariationsCreator::getSkuSettings in src/BulkVariationsCreator.php
Helper method to get variation sku field form display settings.

File

src/BulkVariationsCreator.php, line 39

Class

BulkVariationsCreator
Default implementation of the BulkVariationsCreatorInterface.

Namespace

Drupal\commerce_bulk

Code

public static function getSkuwidget(ProductVariation $variation) {
  $form_display = \Drupal::service('entity_display.repository')
    ->getFormDisplay($variation
    ->getEntityTypeId(), $variation
    ->bundle(), 'default');
  return $form_display
    ->getRenderer('sku');
}