/** * Refund an ecommerce transaction item * * @since 1.0.0 * * @param string $id The id of the transaction * @param string $productId The id of the item * @param int $quantity The quantity to refund * * @return void */ public static function refundItem($id, $productId, $quantity) { GTMdata::pushRefundTransactionItem($id, $productId, $quantity); }
/** * Create a dataLayer push from the current data array * * @since 1.0.0 * * @return void */ private static function pushCurrent() { if (!empty(self::$data)) { self::$json .= 'dataLayer.push(' . json_encode(self::$data, JSON_PRETTY_PRINT) . ');'; self::$data = []; } }