You are here

public function ProductBundleItem::setUnitPrice in Commerce Product Bundle 8

Sets the price of one unit of the referenced product variations.

Parameters

\Drupal\commerce_price\Price $unit_price: The unit price.

Return value

\Drupal\commerce_product_bundle\Entity\BundleItemInterface The called product bundle item entity.

Overrides BundleItemInterface::setUnitPrice

File

src/Entity/ProductBundleItem.php, line 221

Class

ProductBundleItem
Defines the product bundle item entity.

Namespace

Drupal\commerce_product_bundle\Entity

Code

public function setUnitPrice(Price $unit_price) {
  $this
    ->set('unit_price', $unit_price);
  return $this;
}