You are here

public function BundleItemOrderItem::setUnitPrice in Commerce Product Bundle 8

Sets the order item unit price.

Drupal\commerce_price\Price $unit_price The bundle item order item unit price.

Return value

$this

File

src/Entity/BundleItemOrderItem.php, line 100

Class

BundleItemOrderItem
Defines the Bundle Item Order Item entity.

Namespace

Drupal\commerce_product_bundle\Entity

Code

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