static function CommerceGoogleTagManagerHelper::getLineItemsData in Commerce Google Tag Manager 7.2
Parameters
$order:
Return value
array
2 calls to CommerceGoogleTagManagerHelper::getLineItemsData()
- CommerceGoogleTagManagerActionCheckout::execute in includes/
rules/ CommerceGoogleTagManagerActionCheckout.php - Executes the action.
- CommerceGoogleTagManagerActionPurchase::execute in includes/
rules/ CommerceGoogleTagManagerActionPurchase.php - Executes the action.
File
- includes/
CommerceGoogleTagManagerHelper.php, line 136 - This file contains the helper class CommerceGoogleTagManagerHelper.
Class
- CommerceGoogleTagManagerHelper
- @file This file contains the helper class CommerceGoogleTagManagerHelper.
Code
static function getLineItemsData($order, $event = NULL) {
$products = array();
// Loop through the products on the order.
foreach ($order->commerce_line_items as $line_item_wrapper) {
$products[] = self::getLineItemData($line_item_wrapper, $event);
}
return array_filter($products);
}