44 lines
1.3 KiB
PHP
44 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* 2022 ECSoft
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This source file is subject to the Academic Free License (AFL 3.0)
|
|
* that is bundled with this package in the file LICENSE.txt.
|
|
* It is also available through the world-wide-web at this URL:
|
|
* http://opensource.org/licenses/afl-3.0.php
|
|
* If you did not receive a copy of the license and are unable to
|
|
* obtain it through the world-wide-web, please send an email
|
|
* to dev.ecsoft@gmail.com so we can send you a copy immediately.
|
|
*
|
|
* @author ECSoft <dev.ecsoft@gmail.com>
|
|
* @copyright 2022 ECSoft
|
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
|
* International Registered Trademark & Property of ECSoft
|
|
*/
|
|
|
|
class EcsGtmProEcommerce
|
|
{
|
|
public function __construct($datalayer, $currencyCode = null)
|
|
{
|
|
if ($datalayer->getManager()->isEE()) {
|
|
$this->currencyCode = $currencyCode;
|
|
}
|
|
|
|
if ($datalayer->getManager()->isGA4()) {
|
|
$this->currency = $currencyCode;
|
|
}
|
|
}
|
|
|
|
public function mergeObject($object)
|
|
{
|
|
if (is_object($object)) {
|
|
$attributes = get_object_vars($object);
|
|
foreach ($attributes as $attribute => $value) {
|
|
$this->$attribute = $value;
|
|
}
|
|
}
|
|
}
|
|
}
|