You are here

public function AlterProductPurchasedEntityEvent::__construct in Commerce Google Tag Manager 8.2

Same name and namespace in other branches
  1. 8 src/Event/AlterProductPurchasedEntityEvent.php \Drupal\commerce_google_tag_manager\Event\AlterProductPurchasedEntityEvent::__construct()

Constructs a AlterProductPurchasedEntityEvent object.

Parameters

\Drupal\commerce_google_tag_manager\Product $product: The Commerce GTM product class.

\Drupal\commerce_order\Entity\OrderItemInterface $order_item: The order item.

\Drupal\commerce\PurchasableEntityInterface|null $purchased_entity: (optional) The purchased entity.

File

src/Event/AlterProductPurchasedEntityEvent.php, line 48

Class

AlterProductPurchasedEntityEvent
Event to alter the Enhanced Ecommerce product.

Namespace

Drupal\commerce_google_tag_manager\Event

Code

public function __construct(Product $product, OrderItemInterface $order_item, PurchasableEntityInterface $purchased_entity = NULL) {
  $this->product = $product;
  $this->orderItem = $order_item;
  $this->purchasedEntity = $purchased_entity;
}