summaryrefslogtreecommitdiff
path: root/views/mods/mod_statistics/settings_edit.phtml
blob: 245ab4da40dd4539e2350b678a00aa3b4de82da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<?php /** @version 4.6.1 */ ?>
<br/>

<div id="wpsg_tab">	
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Auswertung Bestellstatus', 'wpsg'); ?></a></li>
        <li role="presentation"><a href="#tab2" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('Matomo', 'wpsg'); ?></a></li>
        <li role="presentation"><a href="#tab3" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('Google', 'wpsg'); ?></a></li>
        <li role="presentation"><a href="#tab5" aria-controls="messages" role="tab" data-toggle="tab"><?php echo __('Sonstiges', 'wpsg'); ?></a></li>
    </ul>

	<div class="tab-content" >
		
		<div role="tabpanel" class="tab-pane active" id="tab1" >
		
		<br/>
		
		<?php

			$arSelectedStatus = explode(',', $this->get_option('wpsg_mod_statistics_status'));
			
			echo __('Bitte wählen Sie die Zustände aus unter welchen die Bestellung eines Produktes als abgeschlossen Gültigkeit besitzt.', 'wpsg');
		?>
		<br/><br/>
		<?php
			foreach ($this->arStatus as $statusCode => $statusName)
			{		
				echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_status['.$statusCode.']', $statusName, (is_array($arSelectedStatus) && is_string($arSelectedStatus[0]) && strlen($arSelectedStatus[0]) && in_array($statusCode, $arSelectedStatus)?true:false));
			}
		?>
		

		
			<div class="wpsg_clearer"></div>
		</div>
		
		<div role="tabpanel" class="tab-pane" id="tab2">
			
			<br/>
			
			<?php echo __('Ermöglicht die Integration des Trackingtools "Matomo".', 'wpsg'); ?>
			
			<br/><br/>
		
			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_trackingcode', __('Trackingcode einbinden', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_trackingcode'), array('help' => 'wpsg_mod_statistics_piwik_trackingcode')); ?>
			<div id="wpsg_mod_statistik_tracking_layer" style="display:none;">
				<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_url', __('URL zur Matomo Installation', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_url'), array('help' => 'wpsg_mod_statistics_piwik_url', 'hint' => __('Ohne Protokoll, Beispiel: matomo.domain.de', 'wpsg'))); ?>
				<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_SiteId', __('Matomo Seiten ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_SiteId'), array('help' => 'wpsg_mod_statistics_piwik_SiteId')); ?>
			</div>
			<br />
			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_generel', __('Allgemeine Protokollierung', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_generel'), array('help' => 'wpsg_mod_statistics_piwik_generel')); ?>
			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_ecommerce', __('Käufe (eCommerce) tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_ecommerce'), array('help' => 'wpsg_mod_statistics_piwik_ecommerce')); ?>
			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_productView', __('Produkte tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_productView'), array('help' => 'wpsg_mod_statistics_piwik_productView')); ?>
			<?php if ($this->hasMod('wpsg_mod_produktartikel')) echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_categoryView', __('Produktkategorien tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_categoryView'), array('help' => 'wpsg_mod_statistics_piwik_categoryView')); ?>
			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_basketdata', __('Warenkorbdaten tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_basketdata'), array('help' => 'wpsg_mod_statistics_piwik_basketdata')); ?>
			
			<br /><br />

			<strong><?php echo __('Matomo Goals tracken:', 'wpsg'); ?></strong>
			
			<br />

			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_basket', __('Warenkorb tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_basket'), array('help' => 'wpsg_mod_statistics_piwik_basketdata')); ?>
			<div id="wpsg_mod_statistics_piwik_basket_layer" style="display: none;">
				<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_basket_target', __('Matomo ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_basket_target')); ?>
			</div>
			<br />
			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_checkout', __('Checkout tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_checkout')); ?>
			<div id="wpsg_mod_statistics_piwik_checkout_layer" style="display: none;">
				<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_checkout_target', __('Matomo ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_checkout_target')); ?>
			</div>
			<br />
			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_checkout2', __('Checkout Schritt 2 tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_checkout2')); ?>
			<div id="wpsg_mod_statistics_piwik_checkout2_layer" style="display: none;">
				<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_checkout2_target', __('Matomo ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_checkout2_target')); ?>
			</div>
			<br />
			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_overview', __('Bestellübersicht tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_overview')); ?>
			<div id="wpsg_mod_statistics_piwik_overview_layer" style="display: none;">
				<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_overview_target', __('Matomo ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_overview_target')); ?>
			</div>
			<br />
			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_done', __('Bestellabschluss tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_done')); ?>
			<div id="wpsg_mod_statistics_piwik_done_layer" style="display: none;">
				<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_done_target', __('Matomo ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_done_target')); ?>
			</div>

			<div class="wpsg_clearer"></div>
		</div>

		<script>

			document.addEventListener("DOMContentLoaded", function() {

				var trackingCheckbox = document.getElementById('wpsg_mod_statistics_piwik_trackingcode');
				var trackingDiv = document.getElementById('wpsg_mod_statistik_tracking_layer');

				var basketCheckbox = document.getElementById("wpsg_mod_statistics_piwik_basket");
				var basketDiv = document.getElementById("wpsg_mod_statistics_piwik_basket_layer");

				var checkoutCheckbox = document.getElementById("wpsg_mod_statistics_piwik_checkout");
				var checkoutDiv = document.getElementById("wpsg_mod_statistics_piwik_checkout_layer");

				var checkout2Checkbox = document.getElementById("wpsg_mod_statistics_piwik_checkout2");
				var checkout2Div = document.getElementById("wpsg_mod_statistics_piwik_checkout2_layer");

				var overviewCheckbox = document.getElementById("wpsg_mod_statistics_piwik_overview");
				var overviewDiv = document.getElementById("wpsg_mod_statistics_piwik_overview_layer");

				var doneCheckbox = document.getElementById("wpsg_mod_statistics_piwik_done");
				var doneDiv = document.getElementById("wpsg_mod_statistics_piwik_done_layer");


				function toggleDivVisibility(checkbox, div) 
				{

					if (checkbox.checked) div.style.display = "block";
					else div.style.display = "none";

				}

				// Event Listener für die Checkboxen
				trackingCheckbox.addEventListener("change", function() {
				toggleDivVisibility(trackingCheckbox, trackingDiv);
				});

				basketCheckbox.addEventListener("change", function() {
				toggleDivVisibility(basketCheckbox, basketDiv);
				});

				checkoutCheckbox.addEventListener("change", function() {
				toggleDivVisibility(checkoutCheckbox, checkoutDiv);
				});

				checkout2Checkbox.addEventListener("change", function() {
				toggleDivVisibility(checkout2Checkbox, checkout2Div);
				});

				overviewCheckbox.addEventListener("change", function() {
				toggleDivVisibility(overviewCheckbox, overviewDiv);
				});

				doneCheckbox.addEventListener("change", function() {
				toggleDivVisibility(doneCheckbox, doneDiv);
				});

				// Überprüfen und Initialisieren des Anfangszustands der Checkboxen
				toggleDivVisibility(trackingCheckbox, trackingDiv);
				toggleDivVisibility(basketCheckbox, basketDiv);
				toggleDivVisibility(checkoutCheckbox, checkoutDiv);
				toggleDivVisibility(checkout2Checkbox, checkout2Div);
				toggleDivVisibility(overviewCheckbox, overviewDiv);
				toggleDivVisibility(doneCheckbox, doneDiv);
			});

		</script>
		
		<div role="tabpanel" class="tab-pane" id="tab3">

			<br/>
			
			<?php echo __('Ermöglicht die Integration von "Google Analytics 4".', 'wpsg'); ?>
			
			<br/><br/>

			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_google_active', __('Trackingcode einbinden', 'wpsg'), $this->get_option('wpsg_mod_statistics_google_active'), array('help' => 'wpsg_mod_statistics_google_active')); ?>
			<div id="wpsg_mod_statistik_google_tracking_layer" style="display:none;">
				<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_google_tracking_code', __('Google Tag ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_google_tracking_code'), array('help' => 'wpsg_mod_statistics_google_tracking_code')); ?>
				<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_google_tracking_debug_mode', __('Google Debug Mode', 'wpsg'), $this->get_option('wpsg_mod_statistics_google_tracking_debug_mode'), array('help' => 'wpsg_mod_statistics_google_tracking_debug_mode')); ?>
			</div>
			<br />

			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_google_ecommerce', __('Käufe (eCommerce) tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_google_ecommerce'), array('help' => 'wpsg_mod_statistics_google_ecommerce')); ?>

			<br />

			<?php /* Kartendarstellung START */ ?>
				
		<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_googlekey', __('Google API-Key', 'wpsg'), $this->get_option('wpsg_mod_statistics_googlekey'), array('help' => 'wpsg_mod_statistics_googlekey')); ?>
		
		<a class="button-primary" id="button-google" target="popup" href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend&keyType=CLIENT_SIDE&reusekey=true" onclick="window.open('', 'popup', 'width=500;height=200,resizable=yes,menubar=yes')">
			<?php echo __('Schlüssel über Ihr Googlekonto anfordern', 'wpsg'); ?>
		</a>
		
		<?php /* Kartendarstellung ENDE */?>

			<div class="wpsg_clearer"></div>

		</div>
		
		<script>

			document.addEventListener("DOMContentLoaded", function() {

				var GoogleTrackingCheckbox = document.getElementById('wpsg_mod_statistics_google_active');
				var GoogleTrackingDiv = document.getElementById('wpsg_mod_statistik_google_tracking_layer');

				function toggleGoogleDivVisibility(checkbox, div) 
				{

					if (checkbox.checked) div.style.display = "block";
					else div.style.display = "none";

				}

				// Event Listener für die Checkboxen
				GoogleTrackingCheckbox.addEventListener("change", function() {
				toggleGoogleDivVisibility(GoogleTrackingCheckbox, GoogleTrackingDiv);
				});

				// Überprüfen und Initialisieren des Anfangszustands der Checkboxen
				toggleGoogleDivVisibility(GoogleTrackingCheckbox, GoogleTrackingDiv);

			});

		</script>

		<div role="tabpanel" class="tab-pane" id="tab5">
			<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_line_chart_width', __('Liniendiagramm (Breite in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_line_chart_width'), array('help' => 'wpsg_mod_statistics_line_chart_width')); ?>
			<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_line_chart_height', __('Liniendiagramm (Höhe in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_line_chart_height'), array('help' => 'wpsg_mod_statistics_line_chart_height')); ?>
			<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_pie_chart_width', __('Kuchendiagramm (Breite in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_pie_chart_width'), array('help' => 'wpsg_mod_statistics_pie_chart_width')); ?>
			<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_pie_chart_height', __('Kuchendiagramm (Höhe in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_pie_chart_height'), array('help' => 'wpsg_mod_statistics_pie_chart_height')); ?>
			<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_bar_chart_width', __('Balkendiagramm (Breite in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_bar_chart_width'), array('help' => 'wpsg_mod_statistics_bar_chart_width')); ?>
			<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_bar_chart_height', __('Balkendiagramm (Höhe in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_bar_chart_height'), array('help' => 'wpsg_mod_statistics_bar_chart_height')); ?>
			<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_topproductcount', __('Anzeige Top-Produkte', 'wpsg'), $this->get_option('wpsg_mod_statistics_topproductcount'), array('help' => 'wpsg_mod_statistics_topproductcount')); ?>
			<?php echo wpsg_drawForm_Input('wpsg_mod_statistics_productinterval', __('Intervall-Zeitraum für Produktstatistik', 'wpsg'), $this->get_option('wpsg_mod_statistics_productinterval'), array('help' => 'wpsg_mod_statistics_productinterval')); ?>
			<div class="wpsg_clearer"></div>
		</div>
	
	</div>
</div>

<script type="text/javascript">

	jQuery(document).ready(function() {
		jQuery('#wpsg_tab').wpsg_tab( { 
			'cookiename': 'wpsg_statistics_tab'
		} );
	} );

</script>