You are here

public function BulkVariationsCreatorInterface::getProductVariation in Commerce Bulk 8

Gets a variation for commerce_product.

Parameters

\Drupal\commerce_product\Entity\Product $product: A commerce product, whether new or having some variations saved on it.

Return value

\Drupal\commerce_product\Entity\ProductVariation If exists, the last variation on a commerce_product, otherwise new one.

See also

\Drupal\commerce_product\Entity\ProductVariation->create()

self->createProductVariation()

1 method overrides BulkVariationsCreatorInterface::getProductVariation()
BulkVariationsCreator::getProductVariation in src/BulkVariationsCreator.php
Gets a variation for commerce_product.

File

src/BulkVariationsCreatorInterface.php, line 114

Class

BulkVariationsCreatorInterface
Manages variation combinations creation.

Namespace

Drupal\commerce_bulk

Code

public function getProductVariation(Product $product);