class TrackCheckoutStepEvent in Commerce Google Tag Manager 8
Same name and namespace in other branches
- 8.2 src/Event/TrackCheckoutStepEvent.php \Drupal\commerce_google_tag_manager\Event\TrackCheckoutStepEvent
Event dispatched when a checkout step is tracked.
Event listeners may use this event to track checkout options.
Hierarchy
- class \Drupal\commerce_google_tag_manager\Event\TrackCheckoutStepEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of TrackCheckoutStepEvent
2 files declare their use of TrackCheckoutStepEvent
- EventTrackerService.php in src/
EventTrackerService.php - TrackCheckoutStepEventTest.php in tests/
src/ Kernel/ TrackCheckoutStepEventTest.php
File
- src/
Event/ TrackCheckoutStepEvent.php, line 13
Namespace
Drupal\commerce_google_tag_manager\EventView source
class TrackCheckoutStepEvent extends Event {
/**
* The checkout step number.
*
* @var int
*/
private $stepIndex;
/**
* The order entity.
*
* @var \Drupal\commerce_order\Entity\OrderInterface
*/
private $order;
/**
* Constructs a TrackCheckoutStepEvent object.
*
* @param int $step_index
* The step index of the checkout step, starting at 1.
* @param \Drupal\commerce_order\Entity\OrderInterface $order
* The commerce order representing the current cart.
*/
public function __construct($step_index, OrderInterface $order) {
$this->stepIndex = $step_index;
$this->order = $order;
}
/**
* Get the step index.
*
* @return int
* The step number.
*/
public function getStepIndex() {
return $this->stepIndex;
}
/**
* Get the Checkout current order.
*
* @return \Drupal\commerce_order\Entity\OrderInterface
* The order entity.
*/
public function getOrder() {
return $this->order;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TrackCheckoutStepEvent:: |
private | property | The order entity. | |
TrackCheckoutStepEvent:: |
private | property | The checkout step number. | |
TrackCheckoutStepEvent:: |
public | function | Get the Checkout current order. | |
TrackCheckoutStepEvent:: |
public | function | Get the step index. | |
TrackCheckoutStepEvent:: |
public | function | Constructs a TrackCheckoutStepEvent object. |