Subversion Repositories wpShopGermany4

Rev

Rev 7680 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1902 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Produktübersichtsseite (Gitteransicht)
6341 hartmut 5
	 */
7261 daniel 6
 
1902 daniel 7
	$col = 4;
6341 hartmut 8
 
1902 daniel 9
?>
10
 
2703 daniel 11
<?php
12
 
13
	remove_filter('the_content', array($GLOBALS['wpsg_sc'], 'content_filter'));
14
	the_content();
6341 hartmut 15
	add_filter('the_content', array($GLOBALS['wpsg_sc'], 'content_filter'));
16
 
2703 daniel 17
?>
18
 
1906 daniel 19
<div class="wpsg_mod_productindex wpsg_mod_productindex_grid">
6341 hartmut 20
 
3340 daniel 21
	<form method="get" id="wpsg_mod_productindex_form" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
6341 hartmut 22
 
3540 daniel 23
 		<?php parse_str($_SERVER['QUERY_STRING'], $arGET); if (wpsg_isSizedArray($arGET)) { foreach ($arGET as $key => $value) { if (!wpsg_isSizedArray($value)) { ?>
6812 daniel 24
 		<input type="hidden" name="<?php echo $key; ?>" value="<?php echo htmlspecialchars($value); ?>" />
3540 daniel 25
 		<?php } } } ?>
6341 hartmut 26
 
1902 daniel 27
		<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']; ?>" />
6341 hartmut 28
		<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']; ?>" />
1903 daniel 29
		<input type="hidden" id="wpsg_mod_productindex_template" name="wpsg_mod_productindex[template]" value="<?php echo $this->view['wpsg_mod_productindex']['template']; ?>" />
6341 hartmut 30
 
1902 daniel 31
	</form>
6341 hartmut 32
 
1902 daniel 33
	<div class="wpsg_mod_productindex_toolbar wpsg_mod_productindex_toolbar_top">
6341 hartmut 34
 
1902 daniel 35
		<?php if ($this->view['hideOrder'] != '1') { ?>
6341 hartmut 36
		<div class="wpsg_mod_productindex_order">
1902 daniel 37
			<span><?php echo __('Sortierung:', 'wpsg'); ?></span>
38
			<select name="wpsg_mod_productindex[filter][order]" class="wpsg_mod_productindex_filter_order">
39
				<option value="price_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'price_asc')?'selected="selected"':''); ?>><?php echo __('Preis (Kleinster zuerst)', 'wpsg'); ?></option>
40
				<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>
41
				<option value="name_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'name_asc')?'selected="selected"':''); ?>><?php echo __('Name Aufsteigend', 'wpsg'); ?></option>
42
				<option value="name_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'name_desc')?'selected="selected"':''); ?>><?php echo __('Name Absteigend', 'wpsg'); ?></option>
6342 hartmut 43
				<option value="pos_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'pos_asc')?'selected="selected"':''); ?>><?php echo __('Position Aufsteigend', 'wpsg'); ?></option>
44
				<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>
4376 daniel 45
				<option value="cdate_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'cdate_asc')?'selected="selected"':''); ?>><?php echo __('Erstellungsdatum (Älteste zuerst)', 'wpsg'); ?></option>
46
				<option value="cdate_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'cdate_desc')?'selected="selected"':''); ?>><?php echo __('Erstellungsdatum (Neueste zuerst)', 'wpsg'); ?></option>
3648 daniel 47
				<option value="anr_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'anr_asc')?'selected="selected"':''); ?>><?php echo __('Artikelnummer Aufsteigend', 'wpsg'); ?></option>
48
				<option value="anr_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'anr_desc')?'selected="selected"':''); ?>><?php echo __('Artikelnummer Absteigend', 'wpsg'); ?></option>
1902 daniel 49
			</select>
50
		</div>
51
		<?php } ?>
6341 hartmut 52
 
1902 daniel 53
		<?php if ($this->view['wpsg_mod_productindex']['filter']['pages'] > 1) { ?>
54
		<div class="wpsg_mod_productindex_pager">
55
			<span><?php echo __('Seite:', 'wpsg'); ?></span>
56
			<ul>
57
				<?php for ($i = 1; $i <= $this->view['wpsg_mod_productindex']['filter']['pages']; $i ++) { ?>
58
				<li>
6341 hartmut 59
					<?php if ($i == $this->view['wpsg_mod_productindex']['filter']['page']) { ?>
4891 daniel 60
					<span><?php echo $i; ?></span>
6341 hartmut 61
					<?php } else { ?>
1902 daniel 62
					<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>
63
					<?php } ?>
64
				</li>
65
				<?php } ?>
66
			</ul>
67
		</div>
68
		<?php } ?>
6341 hartmut 69
 
1903 daniel 70
		<?php if ($this->view['hideViewSelect'] != '1') { ?>
71
		<div class="wpsg_mod_productindex_viewselect">
72
			<a href="#" onclick="return wpsg_mod_productindex_viewselect('list.phtml');" title="<?php echo __('Zur Listansicht wechseln.', 'wpsg'); ?>">
73
				<img src="<?php echo $this->getRessourceURL('mods/mod_productindex/gfx/icon_list.png'); ?>" alt="<?php echo __('Zur Listansicht wechseln.', 'wpsg'); ?>" />
74
			</a>
75
		</div>
76
		<?php } ?>
6341 hartmut 77
 
1902 daniel 78
		<div class="wpsg_clear"></div>
6341 hartmut 79
 
1902 daniel 80
	</div>
81
 
82
	<?php if (wpsg_isSizedArray($this->view['arProducts'])) { ?>
6341 hartmut 83
 
7557 daniel 84
		<?php $i = 0; foreach ($this->view['arProducts'] as $p) { $oProduct = wpsg_product::getInstance($p['product_key']); $i ++; ?>
6341 hartmut 85
 
2735 daniel 86
			<?php if (($i - 1) % $col == 0) { ?><div class="wpsg_mod_productindex_productrow"><?php } ?>
6341 hartmut 87
 
88
			<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="width:<?php echo round((100 / $col), 2) ?>%;">
2735 daniel 89
				<div class="wpsg_mod_productindex_product_inner">
6451 thomas 90
 
7192 thomas 91
					<a title="<?php echo __('Zur Detailseite des Produktes', 'wpsg'); ?>" href="<?php echo wpsg_url($p['url']); ?>">
6840 thomas 92
						<?php $attachment_id = $this->imagehandler->getAttachmentID($p['product_key']); ?>
93
						<?php echo wp_get_attachment_image($attachment_id, array(800, 600)); ?>
94
					</a>
6451 thomas 95
 
96
 
2735 daniel 97
					<div class="wpsg_mod_productindex_content">
4091 daniel 98
						<div class="wpsg_mod_productindex_title">
4907 thomas 99
							<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>
6341 hartmut 100
						</div>
101
						<div class="wpsg_mod_productindex_infos">
2735 daniel 102
							<div class="wpsg_mod_productindex_weight">
103
								<?php if ($this->hasMod('wpsg_mod_weight') && $this->get_option('wpsg_mod_weight_showProductindex') == '1') { ?>
6995 thomas 104
									<?php if (($p['weight']) > '0') { ?>
105
										<?php if ($p['min_weight'] == $p['max_weight']) { ?>
106
											<?php echo wpsg_translate(__('Gewicht: #1#', 'wpsg'), wpsg_ff($p['weight'], $this->get_option('wpsg_mod_weight_unit'))); ?>
107
										<?php } else { ?>
108
											<?php echo wpsg_translate(__('Gewicht: ab #1#', 'wpsg'), wpsg_ff($p['min_weight'], $this->get_option('wpsg_mod_weight_unit'))); ?>
109
										<?php } ?>
110
									<?php } ?>
2735 daniel 111
								<?php } ?>
112
							</div>
7680 daniel 113
 
6341 hartmut 114
						</div>
115
 
4910 thomas 116
						<?php if ($this->hasMod('wpsg_mod_stock') && $this->get_option('wpsg_mod_stock_showProductindex') == '1') { ?>
117
							<div class="wpsg_mod_produktindex_stock">
6341 hartmut 118
								<?php echo wpsg_translate(__('Lagerbestand: #1#','wpsg'), $p['stock']);  ?>
4910 thomas 119
							</div>
120
						<?php } ?>
6341 hartmut 121
 
5548 thomas 122
						<?php /*Abfrage Preisanzeige nur für eingeloggte Benutzer START*/?>
7583 daniel 123
						<?php if ($this->canDisplayPrice()) { ?>
7435 thomas 124
							<?php if ($this->hasMod('wpsg_mod_discount') && $this->get_option('wpsg_mod_discount_productindex') == '1') { ?>
125
 
126
    							<?php $oldPrice = $oProduct->getOldPrice();  ?>
127
 
128
                    			<?php if ($oldPrice !== false && $oldPrice != $oProduct->getPrice($this->view['data']['product_key'])) { ?>
129
                    				<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 />
130
                    				<span class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></span>
131
                    			<?php } else { ?>
132
                    				<span class="wpsg_mod_productview_price"><?php echo wpsg_ff($oProduct->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span>
133
                    			<?php } ?>
134
 
135
							<?php }else{?>
5548 thomas 136
							<div class="wpsg_mod_productindex_price">
137
								<?php if ($p['min_preis'] == $p['max_preis']) { ?>
138
									<?php echo wpsg_ff($p['preis'], $this->get_option('wpsg_currency')); ?>
139
								<?php } else { ?>
140
									<?php echo wpsg_translate(__('ab #1#', 'wpsg'), wpsg_ff($p['min_preis'], $this->get_option('wpsg_currency'))); ?>
141
								<?php } ?>
142
							</div>
7435 thomas 143
							<?php } ?>
6341 hartmut 144
							<?php if ($this->get_option('wpsg_kleinunternehmer')) { /* Kleinunternehmerregelung aktiviert START */ ?>
5548 thomas 145
							<div class="wpsg_produkt_preishinweis">
146
								<?php echo wpsg_translate(__('#2# zzgl. #1#', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>', '<a href="#kkhint" title="'.wpsg_hspc($this->get_option('wpsg_kleinunternehmer_text')).'">Endpreis</a>'); ?>
147
							</div>
6341 hartmut 148
							<?php } else { /* Kleinunternehmerregelung aktiviert ENDE */ ?>
149
							<div class="wpsg_produkt_preishinweis">
5548 thomas 150
								<?php if ($this->getFrontendTaxview() == WPSG_NETTO) { /* Frontend = NETTO Preise */ ?>
151
								<?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>'); ?>
152
								<?php } else { /* Frontend = BRUTTO Preise */ ?>
153
								<?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>'); ?>
154
								<?php } ?>
6341 hartmut 155
							</div>
1902 daniel 156
							<?php } ?>
5548 thomas 157
						<?php }else{?>
158
								<?php echo wpsg_translate(__('Preise nur für eingeloggte Benutzer', 'wpsg')); ?>
6341 hartmut 159
						<?php } /* Abfrage Preisanzeige nur für eingeloggte Benutzer ENDE */?>
160
 
7680 daniel 161
						<div class="wpsg_mod_productindex_fmenge">
162
							<?php if ($this->hasMod('wpsg_mod_fuellmenge') && $this->get_option('wpsg_mod_fuellmenge_showProductindex_fmenge') == '1') { ?>
163
								<?php echo $this->callMod('wpsg_mod_fuellmenge', 'renderPriceInfo', [$oProduct->getPrice($p['product_key']), $p['fmenge'], $oProduct->getId()]); ?>
164
							<?php } ?>
165
						</div>
166
 
2735 daniel 167
						<div class="wpsg_mod_productindex_button">
6341 hartmut 168
 
6286 hartmut 169
							<?php //if ($this->hasMod('wpsg_mod_stock') && $this->callMod('wpsg_mod_stock', 'checkBestand', array($this->getProduktID($p['id']), 1)) === false) { ?>
170
							<?php if (false) { ?>
7868 daniel 171
							<span class="wpsg_produkt_soldout"><?php echo __('wpGermany Vollversion erwerben, Updates erhalten und weiterProdukt ausverkauft', 'wpsg'); ?></span>
6341 hartmut 172
							<?php } else { ?>
2735 daniel 173
							<a class="wpsg_button" title="<?php echo __('Zur Detailseite des Produkts', 'wpsg'); ?>" href="<?php echo wpsg_url($p['url']); ?>"><?php echo __('Zum Produkt', 'wpsg'); ?></a>
1902 daniel 174
							<?php } ?>
6341 hartmut 175
 
7435 thomas 176
						</div>
1902 daniel 177
					</div>
2735 daniel 178
					<div class="wpsg_clear"></div>
6341 hartmut 179
				</div>
180
			</div>
181
 
2735 daniel 182
			<?php if (($i - 1) % $col == ($col - 1)) { ?><div class="wpsg_clear"></div></div><?php } ?>
6341 hartmut 183
 
1902 daniel 184
		<?php } ?>
6341 hartmut 185
 
1902 daniel 186
		<?php if (($i - 1) % $col != ($col - 1)) { ?><div class="wpsg_clear"></div></div><?php } ?>
6341 hartmut 187
 
1902 daniel 188
	<?php } else { ?>
189
	<div class="wpsg_mod_productindex_empty"><?php echo __('Keine passenden Produkte gefunden.', 'wpsg'); ?></div>
190
	<?php } ?>
6341 hartmut 191
 
1902 daniel 192
	<div class="wpsg_mod_productindex_toolbar wpsg_mod_productindex_toolbar_bottom">
6341 hartmut 193
 
1902 daniel 194
		<?php if ($this->view['hideOrder'] != '1') { ?>
195
		<div class="wpsg_mod_productindex_order">
196
			<span><?php echo __('Sortierung:', 'wpsg'); ?></span>
197
			<select name="wpsg_mod_productindex[filter][order]" class="wpsg_mod_productindex_filter_order">
198
				<option value="price_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'price_asc')?'selected="selected"':''); ?>><?php echo __('Preis (Kleinster zuerst)', 'wpsg'); ?></option>
199
				<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>
200
				<option value="name_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'name_asc')?'selected="selected"':''); ?>><?php echo __('Name Aufsteigend', 'wpsg'); ?></option>
201
				<option value="name_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'name_desc')?'selected="selected"':''); ?>><?php echo __('Name Absteigend', 'wpsg'); ?></option>
6342 hartmut 202
				<option value="pos_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'pos_asc')?'selected="selected"':''); ?>><?php echo __('Position Aufsteigend', 'wpsg'); ?></option>
203
				<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>
4376 daniel 204
				<option value="cdate_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'cdate_asc')?'selected="selected"':''); ?>><?php echo __('Erstellungsdatum (Älteste zuerst)', 'wpsg'); ?></option>
205
				<option value="cdate_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'cdate_desc')?'selected="selected"':''); ?>><?php echo __('Erstellungsdatum (Neueste zuerst)', 'wpsg'); ?></option>
3648 daniel 206
				<option value="anr_asc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'anr_asc')?'selected="selected"':''); ?>><?php echo __('Artikelnummer Aufsteigend', 'wpsg'); ?></option>
207
				<option value="anr_desc" <?php echo (($this->view['wpsg_mod_productindex']['filter']['order'] == 'anr_desc')?'selected="selected"':''); ?>><?php echo __('Artikelnummer Absteigend', 'wpsg'); ?></option>
1902 daniel 208
			</select>
209
		</div>
210
		<?php } ?>
6341 hartmut 211
 
1902 daniel 212
		<?php if ($this->view['wpsg_mod_productindex']['filter']['pages'] > 1) { ?>
213
		<div class="wpsg_mod_productindex_pager">
214
			<span><?php echo __('Seite:', 'wpsg'); ?></span>
215
			<ul>
216
				<?php for ($i = 1; $i <= $this->view['wpsg_mod_productindex']['filter']['pages']; $i ++) { ?>
217
				<li>
6341 hartmut 218
					<?php if ($i == $this->view['wpsg_mod_productindex']['filter']['page']) { ?>
4891 daniel 219
					<span><?php echo $i; ?></span>
6341 hartmut 220
					<?php } else { ?>
1902 daniel 221
					<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>
222
					<?php } ?>
223
				</li>
224
				<?php } ?>
225
			</ul>
226
		</div>
227
		<?php } ?>
6341 hartmut 228
 
1903 daniel 229
		<?php if ($this->view['hideViewSelect'] != '1') { ?>
230
		<div class="wpsg_mod_productindex_viewselect">
231
			<a href="#" onclick="return wpsg_mod_productindex_viewselect('list.phtml');" title="<?php echo __('Zur Listansicht wechseln.', 'wpsg'); ?>">
232
				<img src="<?php echo $this->getRessourceURL('mods/mod_productindex/gfx/icon_list.png'); ?>" alt="<?php echo __('Zur Listansicht wechseln.', 'wpsg'); ?>" />
233
			</a>
234
		</div>
235
		<?php } ?>
6341 hartmut 236
 
1902 daniel 237
		<div class="wpsg_clear"></div>
6341 hartmut 238
 
1902 daniel 239
	</div>
240
 
241
	<?php if ($this->get_option('wpsg_kleinunternehmer')) { ?>
242
	<a name="kkhint"></a>
2699 david 243
	<div class="wpsg_mod_productindex_kuhint"><?php echo $this->get_option('wpsg_kleinunternehmer_text'); ?></div>
1902 daniel 244
	<?php } ?>
245
 
246
</div>
247
 
248
<script type="text/javascript">/* <![CDATA[ */
249
 
250
	function wpsg_mod_productindex_goPage(page)
251
	{
252
 
253
		jQuery('#wpsg_mod_productindex_filter_page').val(page);
254
		jQuery('#wpsg_mod_productindex_form').submit();
255
 
256
		return false;
6341 hartmut 257
 
1902 daniel 258
	} // function wpsg_mod_productindex_goPage(page)
259
 
1903 daniel 260
	function wpsg_mod_productindex_viewselect(template)
261
	{
262
 
263
		jQuery('#wpsg_mod_productindex_template').val(template);
264
		jQuery('#wpsg_mod_productindex_form').submit();
265
 
266
		return false;
6341 hartmut 267
 
1903 daniel 268
	} // function wpsg_mod_productindex_viewselect(template)
6341 hartmut 269
 
1902 daniel 270
	jQuery(document).ready(function() {
271
 
272
		jQuery('.wpsg_mod_productindex_filter_order').bind('change', function() {
6341 hartmut 273
 
1902 daniel 274
			jQuery('#wpsg_mod_productindex_filter_order').val(jQuery(this).find('option:selected').attr('value'));
275
			jQuery('#wpsg_mod_productindex_filter_page').val('1');
6341 hartmut 276
			jQuery('#wpsg_mod_productindex_form').submit();
277
 
1902 daniel 278
		} );
6341 hartmut 279
 
6451 thomas 280
	} );
281
 
1902 daniel 282
/* ]]> */</script>