public function BulkVariationsCreatorInterface::createProductVariation in Commerce Bulk 8
Creates a variation for commerce_product.
Parameters
\Drupal\commerce_product\Entity\Product $product: A commerce product, whether new or having some variations saved on it.
array $variation_custom_values: (optional) An associative array of a variation property values which will be used to auto create sample variation.
array $not_all: (optional) Additional settings to pass, such as the maximum number of variation combinations to create.
Return value
\Drupal\commerce_product\Entity\ProductVariation A commerce_product variation.
See also
\Drupal\commerce_product\Entity\ProductVariation->create()
self->createAllProductVariations()
1 method overrides BulkVariationsCreatorInterface::createProductVariation()
- BulkVariationsCreator::createProductVariation in src/
BulkVariationsCreator.php - Creates a variation for commerce_product.
File
- src/
BulkVariationsCreatorInterface.php, line 134
Class
- BulkVariationsCreatorInterface
- Manages variation combinations creation.
Namespace
Drupal\commerce_bulkCode
public function createProductVariation(Product $product, array $variation_custom_values = [], array $not_all = []);