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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
|
<?php
/**
* Template für die Produktübersichtsseite (Gitteransicht)
* @version 4.6.1
*/
$col = 4;
?>
<?php
remove_filter('the_content', array($GLOBALS['wpsg_sc'], 'content_filter'));
the_content();
add_filter('the_content', array($GLOBALS['wpsg_sc'], 'content_filter'));
?>
<div class="wpsg_mod_productindex wpsg_mod_productindex_grid">
<form method="get" id="wpsg_mod_productindex_form" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<?php parse_str($_SERVER['QUERY_STRING'], $arGET); if (wpsg_isSizedArray($arGET)) { foreach ($arGET as $key => $value) { if (!wpsg_isSizedArray($value)) { ?>
<input type="hidden" name="<?php echo $key; ?>" value="<?php echo htmlspecialchars($value); ?>" />
<?php } } } ?>
<input type="hidden" id="wpsg_mod_productindex_filter_page" name="wpsg_mod_productindex[filter][page]" value="<?php echo $this->view['wpsg_mod_productindex']['filter']['page']; ?>" />
<input type="hidden" id="wpsg_mod_productindex_filter_order" name="wpsg_mod_productindex[filter][order]" value="<?php echo $this->view['wpsg_mod_productindex']['filter']['order']; ?>" />
<input type="hidden" id="wpsg_mod_productindex_template" name="wpsg_mod_productindex[template]" value="<?php echo $this->view['wpsg_mod_productindex']['template']; ?>" />
</form>
<div class="wpsg_mod_productindex_toolbar wpsg_mod_productindex_toolbar_top">
<?php if ($this->view['hideOrder'] != '1') { ?>
<div class="wpsg_mod_productindex_order">
<span><?php echo __('Sortierung:', 'wpsg'); ?></span>
<select name="wpsg_mod_productindex[filter][order]" class="wpsg_mod_productindex_filter_order">
<option value="price_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'price_asc')?'selected="selected"':''); ?>><?php echo __('Preis (Kleinster zuerst)', 'wpsg'); ?></option>
<option value="price_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'price_desc')?'selected="selected"':''); ?>><?php echo __('Preis (Größter zuerst)', 'wpsg'); ?></option>
<option value="name_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'name_asc')?'selected="selected"':''); ?>><?php echo __('Name Aufsteigend', 'wpsg'); ?></option>
<option value="name_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'name_desc')?'selected="selected"':''); ?>><?php echo __('Name Absteigend', 'wpsg'); ?></option>
<option value="pos_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'pos_asc')?'selected="selected"':''); ?>><?php echo __('Position Aufsteigend', 'wpsg'); ?></option>
<option value="pos_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'pos_desc')?'selected="selected"':''); ?>><?php echo __('Position Absteigend', 'wpsg'); ?></option> <option value="cdate_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'cdate_asc')?'selected="selected"':''); ?>><?php echo __('Erstellungsdatum (Älteste zuerst)', 'wpsg'); ?></option>
<option value="cdate_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'cdate_asc')?'selected="selected"':''); ?>><?php echo __('Erstellungsdatum (Älteste zuerst)', 'wpsg'); ?></option>
<option value="cdate_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'cdate_desc')?'selected="selected"':''); ?>><?php echo __('Erstellungsdatum (Neueste zuerst)', 'wpsg'); ?></option>
<option value="anr_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'anr_asc')?'selected="selected"':''); ?>><?php echo __('Artikelnummer Aufsteigend', 'wpsg'); ?></option>
<option value="anr_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'anr_desc')?'selected="selected"':''); ?>><?php echo __('Artikelnummer Absteigend', 'wpsg'); ?></option>
</select>
</div>
<?php } ?>
<?php if ($this->view['wpsg_mod_productindex']['filter']['pages'] > 1) { ?>
<div class="wpsg_mod_productindex_pager">
<span><?php echo __('Seite:', 'wpsg'); ?></span>
<ul>
<?php for ($i = 1; $i <= $this->view['wpsg_mod_productindex']['filter']['pages']; $i ++) { ?>
<li>
<?php if ($i == $this->view['wpsg_mod_productindex']['filter']['page']) { ?>
<span><?php echo $i; ?></span>
<?php } else { ?>
<a title="<?php echo wpsg_translate(__('Zu Seite #1# wechseln', 'wpsg'), $i); ?>" href="#" onclick="return wpsg_mod_productindex_goPage(<?php echo $i; ?>);"><?php echo $i; ?></a>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
<?php } ?>
<?php if ($this->view['hideViewSelect'] != '1') { ?>
<div class="wpsg_mod_productindex_viewselect">
<a href="#" onclick="return wpsg_mod_productindex_viewselect('list.phtml');" title="<?php echo __('Zur Listansicht wechseln.', 'wpsg'); ?>">
<img src="<?php echo $this->getRessourceURL('mods/mod_productindex/gfx/icon_list.png'); ?>" alt="<?php echo __('Zur Listansicht wechseln.', 'wpsg'); ?>" />
</a>
</div>
<?php } ?>
<div class="wpsg_clear"></div>
</div>
<?php if (wpsg_isSizedArray($this->view['arProducts'])) { ?>
<?php $i = 0; foreach ($this->view['arProducts'] as $p) { $oProduct = wpsg_product::getInstance($p['product_key']); $i ++; ?>
<?php if (($i - 1) % $col == 0) { ?><div class="wpsg_mod_productindex_productrow"><?php } ?>
<div class="wpsg_mod_productindex_product <?php echo (($i == sizeof($this->view['arProducts']))?'wpsg_mod_productindex_product_last':''); ?> <?php echo (($i == 1)?'wpsg_mod_productindex_product_first':''); ?>" style="<?php echo ((\wpsg\ThemeStyle::isThemeMode())?'--wpsg-columns:'.intval($col):'width:'.round((100 / $col), 2).'%'); ?>;">
<div class="wpsg_mod_productindex_product_inner">
<a title="<?php echo __('Zur Detailseite des Produktes', 'wpsg'); ?>" href="<?php echo wpsg_url($p['url']); ?>">
<?php $attachment_id = $this->imagehandler->getAttachmentID($p['product_key']); ?>
<?php echo wp_get_attachment_image($attachment_id, array(800, 600)); ?>
</a>
<div class="wpsg_mod_productindex_content">
<div class="wpsg_mod_productindex_title">
<a title="<?php echo __('Zur Detailseite des Produkts', 'wpsg'); ?>" href="<?php echo wpsg_url($p['url']); ?>"><?php echo $this->getProductName($this->getProduktID($p['id']), true); ?></a>
</div>
<div class="wpsg_mod_productindex_infos">
<div class="wpsg_mod_productindex_weight">
<?php if ($this->hasMod('wpsg_mod_weight') && $this->get_option('wpsg_mod_weight_showProductindex') == '1') { ?>
<?php if (($p['weight']) > '0') { ?>
<?php if ($p['min_weight'] == $p['max_weight']) { ?>
<?php echo wpsg_translate(__('Gewicht: #1#', 'wpsg'), wpsg_ff($p['weight'], $this->get_option('wpsg_mod_weight_unit'))); ?>
<?php } else { ?>
<?php echo wpsg_translate(__('Gewicht: ab #1#', 'wpsg'), wpsg_ff($p['min_weight'], $this->get_option('wpsg_mod_weight_unit'))); ?>
<?php } ?>
<?php } ?>
<?php } ?>
</div>
</div>
<?php if ($this->hasMod('wpsg_mod_stock') && $this->get_option('wpsg_mod_stock_showProductindex') == '1') { ?>
<div class="wpsg_mod_produktindex_stock">
<?php echo wpsg_translate(__('Lagerbestand: #1#','wpsg'), $p['stock']); ?>
</div>
<?php } ?>
<?php /*Abfrage Preisanzeige nur für eingeloggte Benutzer START*/?>
<?php if ($this->canDisplayPrice()) { ?>
<?php if ($this->hasMod('wpsg_mod_discount') && $this->get_option('wpsg_mod_discount_productindex') == '1') { ?>
<?php $oldPrice = $oProduct->getOldPrice(); ?>
<?php if ($oldPrice !== false && $oldPrice != $oProduct->getPrice($this->view['data']['product_key'])) { ?>
<span class="wpsg_mod_productview_newprice wpsg_mod_productview_price wpsg_mod_productview_current"><?php echo wpsg_ff($oProduct->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span><br />
<span class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></span>
<?php } else { ?>
<span class="wpsg_mod_productview_price"><?php echo wpsg_ff($oProduct->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span>
<?php } ?>
<?php }else{?>
<div class="wpsg_mod_productindex_price">
<?php if ($p['min_preis'] == $p['max_preis']) { ?>
<?php echo wpsg_ff($p['preis'], $this->get_option('wpsg_currency')); ?>
<?php } else { ?>
<?php echo wpsg_translate(__('ab #1#', 'wpsg'), wpsg_ff($p['min_preis'], $this->get_option('wpsg_currency'))); ?>
<?php } ?>
</div>
<?php } ?>
<?php if ($this->get_option('wpsg_kleinunternehmer')) { /* Kleinunternehmerregelung aktiviert START */ ?>
<div class="wpsg_produkt_preishinweis">
<?php echo wpsg_translate(__('#2# zzgl. #1#', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>', '<a href="#kkhint">'.esc_html__('Endpreis', 'wpsg').'</a>'); ?>
</div>
<?php } else { /* Kleinunternehmerregelung aktiviert ENDE */ ?>
<div class="wpsg_produkt_preishinweis">
<?php if ($this->getFrontendTaxview() == WPSG_NETTO) { /* Frontend = NETTO Preise */ ?>
<?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($p['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>
<?php } else { /* Frontend = BRUTTO Preise */ ?>
<?php echo wpsg_translate(__('(inkl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($p['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>
<?php } ?>
</div>
<?php } ?>
<?php }else{?>
<?php echo wpsg_translate(__('Preise nur für eingeloggte Benutzer', 'wpsg')); ?>
<?php } /* Abfrage Preisanzeige nur für eingeloggte Benutzer ENDE */?>
<div class="wpsg_mod_productindex_fmenge">
<?php if ($this->hasMod('wpsg_mod_fuellmenge') && $this->get_option('wpsg_mod_fuellmenge_showProductindex_fmenge') == '1') { ?>
<?php echo $this->callMod('wpsg_mod_fuellmenge', 'renderPriceInfo', [$oProduct->getPrice($p['product_key']), $p['fmenge'], $oProduct->getId()]); ?>
<?php } ?>
</div>
<div class="wpsg_mod_productindex_button">
<?php //if ($this->hasMod('wpsg_mod_stock') && $this->callMod('wpsg_mod_stock', 'checkBestand', array($this->getProduktID($p['id']), 1)) === false) { ?>
<?php if (false) { ?>
<span class="wpsg_produkt_soldout"><?php echo __('Produkt ausverkauft', 'wpsg'); ?></span>
<?php } else { ?>
<a class="wpsg_button<?php echo wpsg_button_class(); ?>" title="<?php echo __('Zur Detailseite des Produkts', 'wpsg'); ?>" href="<?php echo wpsg_url($p['url']); ?>"><?php echo esc_html(wpsg_button_text('to_product', __('Zum Produkt', 'wpsg'))); ?></a>
<?php } ?>
</div>
</div>
<div class="wpsg_clear"></div>
</div>
</div>
<?php if (($i - 1) % $col == ($col - 1)) { ?><div class="wpsg_clear"></div></div><?php } ?>
<?php } ?>
<?php if (($i - 1) % $col != ($col - 1)) { ?><div class="wpsg_clear"></div></div><?php } ?>
<?php } else { ?>
<div class="wpsg_mod_productindex_empty"><?php echo __('Keine passenden Produkte gefunden.', 'wpsg'); ?></div>
<?php } ?>
<div class="wpsg_mod_productindex_toolbar wpsg_mod_productindex_toolbar_bottom">
<?php if ($this->view['hideOrder'] != '1') { ?>
<div class="wpsg_mod_productindex_order">
<span><?php echo __('Sortierung:', 'wpsg'); ?></span>
<select name="wpsg_mod_productindex[filter][order]" class="wpsg_mod_productindex_filter_order">
<option value="price_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'price_asc')?'selected="selected"':''); ?>><?php echo __('Preis (Kleinster zuerst)', 'wpsg'); ?></option>
<option value="price_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'price_desc')?'selected="selected"':''); ?>><?php echo __('Preis (Größter zuerst)', 'wpsg'); ?></option>
<option value="name_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'name_asc')?'selected="selected"':''); ?>><?php echo __('Name Aufsteigend', 'wpsg'); ?></option>
<option value="name_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'name_desc')?'selected="selected"':''); ?>><?php echo __('Name Absteigend', 'wpsg'); ?></option>
<option value="pos_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'pos_asc')?'selected="selected"':''); ?>><?php echo __('Position Aufsteigend', 'wpsg'); ?></option>
<option value="pos_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'pos_desc')?'selected="selected"':''); ?>><?php echo __('Position Absteigend', 'wpsg'); ?></option> <option value="cdate_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'cdate_asc')?'selected="selected"':''); ?>><?php echo __('Erstellungsdatum (Älteste zuerst)', 'wpsg'); ?></option>
<option value="cdate_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'cdate_asc')?'selected="selected"':''); ?>><?php echo __('Erstellungsdatum (Älteste zuerst)', 'wpsg'); ?></option>
<option value="cdate_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'cdate_desc')?'selected="selected"':''); ?>><?php echo __('Erstellungsdatum (Neueste zuerst)', 'wpsg'); ?></option>
<option value="anr_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'anr_asc')?'selected="selected"':''); ?>><?php echo __('Artikelnummer Aufsteigend', 'wpsg'); ?></option>
<option value="anr_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'anr_desc')?'selected="selected"':''); ?>><?php echo __('Artikelnummer Absteigend', 'wpsg'); ?></option>
</select>
</div>
<?php } ?>
<?php if ($this->view['wpsg_mod_productindex']['filter']['pages'] > 1) { ?>
<div class="wpsg_mod_productindex_pager">
<span><?php echo __('Seite:', 'wpsg'); ?></span>
<ul>
<?php for ($i = 1; $i <= $this->view['wpsg_mod_productindex']['filter']['pages']; $i ++) { ?>
<li>
<?php if ($i == $this->view['wpsg_mod_productindex']['filter']['page']) { ?>
<span><?php echo $i; ?></span>
<?php } else { ?>
<a title="<?php echo wpsg_translate(__('Zu Seite #1# wechseln', 'wpsg'), $i); ?>" href="#" onclick="return wpsg_mod_productindex_goPage(<?php echo $i; ?>);"><?php echo $i; ?></a>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
<?php } ?>
<?php if ($this->view['hideViewSelect'] != '1') { ?>
<div class="wpsg_mod_productindex_viewselect">
<a href="#" onclick="return wpsg_mod_productindex_viewselect('list.phtml');" title="<?php echo __('Zur Listansicht wechseln.', 'wpsg'); ?>">
<img src="<?php echo $this->getRessourceURL('mods/mod_productindex/gfx/icon_list.png'); ?>" alt="<?php echo __('Zur Listansicht wechseln.', 'wpsg'); ?>" />
</a>
</div>
<?php } ?>
<div class="wpsg_clear"></div>
</div>
<?php if ($this->get_option('wpsg_kleinunternehmer')) { ?>
<?php /* Ziel des Links „Endpreis“; der title-Text erreichte Tastatur und Screenreader nicht (P31) */ ?>
<div class="wpsg_mod_productindex_kuhint" id="kkhint"><?php echo wp_kses_post((string)$this->get_option('wpsg_kleinunternehmer_text')); ?></div>
<?php } ?>
</div>
<script type="text/javascript">/* <![CDATA[ */
function wpsg_mod_productindex_goPage(page)
{
jQuery('#wpsg_mod_productindex_filter_page').val(page);
jQuery('#wpsg_mod_productindex_form').trigger('submit');
return false;
} // function wpsg_mod_productindex_goPage(page)
function wpsg_mod_productindex_viewselect(template)
{
jQuery('#wpsg_mod_productindex_template').val(template);
jQuery('#wpsg_mod_productindex_form').trigger('submit');
return false;
} // function wpsg_mod_productindex_viewselect(template)
jQuery(document).ready(function() {
jQuery('.wpsg_mod_productindex_filter_order').bind('change', function() {
jQuery('#wpsg_mod_productindex_filter_order').val(jQuery(this).find('option:selected').attr('value'));
jQuery('#wpsg_mod_productindex_filter_page').val('1');
jQuery('#wpsg_mod_productindex_form').trigger('submit');
} );
} );
/* ]]> */</script>
|