public function CartManagerInterface::createOrderItem in Commerce Core 8.2
Creates an order item for the given purchasable entity.
Parameters
\Drupal\commerce\PurchasableEntityInterface $entity: The purchasable entity.
string $quantity: The quantity.
Return value
\Drupal\commerce_order\Entity\OrderItemInterface The created order item. Unsaved.
1 method overrides CartManagerInterface::createOrderItem()
- CartManager::createOrderItem in modules/
cart/ src/ CartManager.php - Creates an order item for the given purchasable entity.
File
- modules/
cart/ src/ CartManagerInterface.php, line 54
Class
- CartManagerInterface
- Manages the cart order and its order items.
Namespace
Drupal\commerce_cartCode
public function createOrderItem(PurchasableEntityInterface $entity, $quantity = '1');