diff --git a/Application/views/blocks/checkout_s1.tpl b/Application/views/blocks/checkout_s1.tpl index 12cab6b..79bfee6 100644 --- a/Application/views/blocks/checkout_s1.tpl +++ b/Application/views/blocks/checkout_s1.tpl @@ -11,7 +11,7 @@ 'ecommerce': { 'actionField': "step: 1", 'currency': "[{$currency->name}]", - 'value': [{$oxcmp_basket->getBruttoSum()}], + 'value': [{oxprice price=$oxcmp_basket->getPrice()}], 'items': [ [{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}] [{assign var='_price' value=$basketitem->getUnitPrice()}] diff --git a/Application/views/ga4/add_to_cart.tpl b/Application/views/ga4/add_to_cart.tpl index 37316b1..83062ec 100644 --- a/Application/views/ga4/add_to_cart.tpl +++ b/Application/views/ga4/add_to_cart.tpl @@ -3,6 +3,7 @@ [{*$gtmProduct|get_class_methods|dumpvar*}] [{capture assign=d3_ga4_add_to_cart}] +[{block name="d3_ga4_add_to_basket"}] $("#toBasket").click(function(event) { [{*event.preventDefault();*}] @@ -38,7 +39,7 @@ } }); }); - +[{/block}] [{/capture}] [{oxscript add=$d3_ga4_add_to_cart}] diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fd5403..c8ef66b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [2.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...2.0) - 2023-01-20 -### Changed - using of ContainerFactory in ViewConfig +## [1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.1) - 2023-01-27 +### Added +- block section for add_to_basket js +- template block order positions ## [1.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.0) - 2023-01-20 ### Added diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index 71f9add..dfec23c 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -1,24 +1,19 @@ - * @link http://www.oxidmodule.com + * @author D3 Data Development - Daniel Seifert + * @link https://www.oxidmodule.com */ namespace D3\GoogleAnalytics4\Modules\Core; use OxidEsales\Eshop\Application\Controller\FrontendController; use OxidEsales\Eshop\Core\Registry; -use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory; -use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface; class ViewConfig extends ViewConfig_parent { diff --git a/README.md b/README.md index a1c31dd..228ad5e 100644 --- a/README.md +++ b/README.md @@ -20,17 +20,8 @@ Weiterführende Informationen: https://developers.google.com/analytics/devguides Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in der [composer.json](composer.json) definierten Version. -Bitte tragen Sie den folgenden Abschnitt in die `composer.json` Ihres Projektes ein: - -``` - "extra": { - optionale Anweisungen von 3rd-Party-Packages (z.B. Patch- oder Symlink-Anweisungen) - } -``` - Öffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). Führen Sie den folgenden Befehl aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an. - ```bash php composer require d3/google-analytics4:^1 ``` diff --git a/metadata.php b/metadata.php index caf3e9f..557119f 100755 --- a/metadata.php +++ b/metadata.php @@ -111,13 +111,15 @@ $aModule = [ [ 'template' => 'widget/product/list.tpl', 'block' => 'd3Ga4_view_item_list', - 'file' => '/Application/views/ga4/view_item_list.tpl' + 'file' => '/Application/views/ga4/view_item_list.tpl', + 'position' => 150 ], // view_search_result [ 'template' => 'page/search/search.tpl', 'block' => 'search_results', - 'file' => '/Application/views/ga4/search.tpl' + 'file' => '/Application/views/ga4/search.tpl', + 'position' => 150 ], // add_to_cart [