Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions MageWire/Component.php

This file was deleted.

10 changes: 10 additions & 0 deletions MageWire/Component/AbstractComponent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php declare(strict_types=1);

namespace Tagging\GTM\MageWire\Component;

use Magento\Framework\View\Element\Block\ArgumentInterface;

abstract class AbstractComponent implements ArgumentInterface
{
abstract public function isHyvaCheckoutEnabled(): bool;
}
15 changes: 15 additions & 0 deletions MageWire/Component/ComponentFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php declare(strict_types=1);

namespace Tagging\GTM\MageWire\Component;

class ComponentFactory
{
public function create(): AbstractComponent
{
if (class_exists('\Magewirephp\Magewire\Component')) {
return new MagewireComponent();
}

return new DefaultComponent();
}
}
11 changes: 11 additions & 0 deletions MageWire/Component/DefaultComponent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php declare(strict_types=1);

namespace Tagging\GTM\MageWire\Component;

class DefaultComponent extends AbstractComponent
{
public function isHyvaCheckoutEnabled(): bool
{
return false;
}
}
11 changes: 11 additions & 0 deletions MageWire/Component/MagewireComponent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php declare(strict_types=1);

namespace Tagging\GTM\MageWire\Component;

class MagewireComponent extends \Magewirephp\Magewire\Component
{
public function isHyvaCheckoutEnabled(): bool
{
return true;
}
}
36 changes: 0 additions & 36 deletions Setup/UpgradeSchema.php

This file was deleted.

54 changes: 0 additions & 54 deletions Test/Integration/Util/ProductDataMapperTest.php

This file was deleted.

7 changes: 7 additions & 0 deletions etc/db_schema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="sales_order" resource="default" engine="innodb">
<column xsi:type="text" name="trytagging_marketing" nullable="true" comment="TryTagging Marketing Data"/>
</table>
</schema>
6 changes: 6 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,10 @@
<type name="Magento\Sales\Api\OrderRepositoryInterface">
<plugin name="tagging_gtm_order_repository_plugin" type="Tagging\GTM\Plugin\OrderRepositoryPlugin" />
</type>

<type name="Tagging\GTM\MageWire\Component\AbstractComponent">
<arguments>
<argument name="componentFactory" xsi:type="object">Tagging\GTM\MageWire\Component\ComponentFactory</argument>
</arguments>
</type>
</config>
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Tagging_GTM" setup_version="1.0.6">
<module name="Tagging_GTM">
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Catalog"/>
Expand Down
4 changes: 2 additions & 2 deletions view/frontend/templates/hyva_checkout/data-layer.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ declare(strict_types=1);

use Magento\Framework\View\Element\Template;
use Tagging\GTM\DataLayer\Event\BeginCheckout as BeginCheckoutEvent;
use Tagging\GTM\MageWire\Checkout as CheckoutComponent;
use Tagging\GTM\MageWire\Component\AbstractComponent;

/** @var Template $block */
/** @var BeginCheckoutEvent $beginCheckoutEvent */
/** @var CheckoutComponent $magewire */
/** @var AbstractComponent $magewire */
$magewire = $block->getData('magewire');
if (false === $magewire->isHyvaCheckoutEnabled()) {
return;
Expand Down