summaryrefslogtreecommitdiff
path: root/views/mods/mod_productview/productview.phtml
blob: 26d70b97f4fd0b363517c3893c1b1e21e63a38ac (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
<?php

	/**
	 * Template für die Anzeige der Produkte
	 * Es sollte nur Inhalt unter dem Div der Klasse wpsg_productview geändert werden, da dieses mittels AJAX ausgetauscht wird 
	 */

?>
<div class="wpsg_productview" id="wpsg_productview_<?php echo $this->view['wpsg_mod_productview']['index']; ?>">
	
	<input type="hidden" name="wpsg_atts" value="<?php echo @wpsg_hspc(json_encode($this->view['wpsg_mod_productview']['atts'])); ?>" />
	
	<div class="wpsg_productview_head row">
	
		<?php if ($this->view['wpsg_mod_productview']['cols'] != 3) { ?>
		<h2 class="wpsg_productview_title <?php echo $this->view['wpsg_mod_productview']['col_class']['title']; ?>"><?php echo wpsg_hspc($this->view['wpsg_mod_productview']['title']); ?></h2>
		<?php } ?>
		
		<?php if (wpsg_isSizedArray($this->view['wpsg_mod_productview']['products'])) { ?>
		<div class="wpsg_mod_productview-order <?php echo $this->view['wpsg_mod_productview']['col_class']['order']; ?>">
			<?php echo __('Sortierung', 'wpsg'); $order = $this->view['wpsg_mod_productview']['order']; ?>
			<?php if (substr($order, -3) === 'asc') { ?>
			<span class="glyphicon glyphicon-menu-up"></span>
			<?php } else { ?>
			<span class="glyphicon glyphicon-menu-down"></span>
			<?php } ?>
			
			<strong><?php echo $this->view['wpsg_mod_productview']['arOrder'][$order]; ?></strong>
			<div class="wpsg_mod_productview-order-layer">
				<div class="inner">
					<?php foreach ($this->view['wpsg_mod_productview']['arOrder'] as $value => $label) { ?>
					<a href="#" class="<?php echo (($this->view['wpsg_mod_productview']['order'] === $value)?'selected':''); ?>" data-productview-index="<?php echo $this->view['wpsg_mod_productview']['index']; ?>" data-order="<?php echo $value; ?>"><?php echo $label; ?></a>
					<?php } ?>				
				</div>			
			</div>			
		</div>
		
		<div class="wpsg_mod_productview-info <?php echo $this->view['wpsg_mod_productview']['col_class']['info']; ?>">
			<strong><?php 
				echo wpsg_translate(__('Anzeige #1# - #2#', 'wpsg'), 
					($this->view['wpsg_mod_productview']['page'] - 1) * $this->view['wpsg_mod_productview']['per_page'] + 1, 
					$this->view['wpsg_mod_productview']['pageMax']
				); ?></strong>
			<?php echo wpsg_translate(__('von #1# Ergebnissen', 'wpsg'), $this->view['wpsg_mod_productview']['count']); ?>
		</div>
		<?php } ?>

		<div class="wpsg_mod_productview_modeswitch">
			<a href="#" title="<?php echo __('Schaltet die Produktansicht auf die Grid Ansicht um.', 'wpsg'); ?>" class="fa fa-th <?php echo (($this->view['wpsg_mod_productview']['mode'] == 'grid')?'active':''); ?>"></a>
			<a href="#" title="<?php echo __('Schaltet die Produktansicht auf die List Ansicht um.', 'wpsg'); ?>" class="fa fa-list <?php echo (($this->view['wpsg_mod_productview']['mode'] == 'list')?'active':''); ?>"></a>
		</div>

	</div>
	
	<div class="wpsg_productview_content row">
	
		<?php if (wpsg_isSizedArray($this->view['wpsg_mod_productview']['products'])) { ?>
		
			<?php $i = 0; foreach ($this->view['wpsg_mod_productview']['products'] as $oProduct) { $i ++; ?>

			<div style="<?php echo (($this->view['wpsg_mod_productview']['mode'] == 'list')?'':'display:none;'); ?>" class="wpsg_productview_product wpsg_productview_product_list wpsg_productview_product_<?php echo $oProduct->id; ?> col-md-12">

				<div class="row">

					<?php $bImage = false; if ($this->hasMod('wpsg_mod_produktbilder')) { ?>
					<?php $image_url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage', array($oProduct->id, 520, 520, 'sz')); ?>
					<?php if (wpsg_isSizedString($image_url)) { $bImage = true; ?>
					<div class="col-md-4 wpsg_mod_productview_image">

						<img src="<?php echo $image_url; ?>" alt="" />

					</div>
					<?php } ?>
					<?php } ?>

					<div class="col-md-<?php echo (($bImage)?'8':'12'); ?>">

						<div class="wpsg_mod_productview_name">
							<h2><?php echo $oProduct->getProductName(); ?></h2>
						</div>

						<?php if ($oProduct->rating > 0) { ?>
						<div class="wpsg_star_wrap">
							<?php for ($i = 0; $i < 5; $i ++) { ?><i class="fa fa-star <?php echo (($i >= $oProduct->rating)?'fa-star-active':''); ?>"></i><?php } ?>
						</div>
						<?php } ?>

						<div class="wpsg_mod_productview_price_wrap">
							<?php $oldPrice = $oProduct->getOldPrice(); ?>
							<?php if ($oldPrice !== false && $oldPrice != $oProduct->getPrice()) { ?>
								<div class="wpsg_mod_productview_current"><?php echo wpsg_ff($oProduct->getPrice(), $this->get_option('wpsg_currency')); ?></div>
								<div class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></div>
							<?php } else { ?>
								<div class="wpsg_mod_productview_price"><?php echo wpsg_ff($oProduct->getPrice(), $this->get_option('wpsg_currency')); ?></div>
							<?php } ?>
						</div>

						<div class="wpsg_mod_productview_tax_wrap">
							<?php if ($this->getFrontendTaxview() == WPSG_BRUTTO) { ?>
								<?php echo wpsg_translate(__('inkl. #1#% MwSt. zzgl. <a href="#2">Versandkosten</a>', 'wpsg'), $oProduct->getFrontendTaxValue(), $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)); ?>
							<?php } else if ($this->getFrontendTaxview() == WPSG_NETTO) { ?>
								<?php echo wpsg_translate(__('zzgl. #1#% MwSt. zzgl. <a href="#2">Versandkosten</a>', 'wpsg'), $oProduct->getFrontendTaxValue(), $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)); ?>
							<?php } ?>
						</div>

						<?php $shortDescription = $oProduct->getShortDescription(); if (wpsg_isSizedString($shortDescription)) { ?>
						<div class="wpsg_mod_productview_description theme_color_1">
							<strong><?php echo __('Produktbeschreibung', 'wpsg'); ?></strong><br />
							<?php echo wp_trim_words(apply_filters('the_content', $shortDescription), 90); ?>
						</div>
						<?php } ?>

						<a class="wpsg_mod_productview_button" href="<?php echo $oProduct->getProductURL(); ?>"><?php echo __('Zum Produkt', 'wpsg'); ?><span class="fa fa-angle-double-right"></span></a>

					</div>

				</div>

			</div>

			<div style="<?php echo (($this->view['wpsg_mod_productview']['mode'] == 'grid')?'':'display:none;'); ?>" class="<?php echo (($this->view['wpsg_mod_productview']['mode'] == 'grid')?'':'hidden'); ?> wpsg_productview_product wpsg_productview_product_grid wpsg_productview_product_<?php echo $oProduct->id; ?> <?php echo $this->view['wpsg_mod_productview']['col_class']['product']; ?>">
				
				<?php if ($this->hasMod('wpsg_mod_produktbilder')) { ?>
				<?php $image_url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage', array($oProduct->id, 520, 520, 'sz')); ?>
				<?php if (wpsg_isSizedString($image_url)) { ?>
				<div class="wpsg_mod_productview_image">
				
					<img src="<?php echo $image_url; ?>" alt="" />
					
					<div class="wpsg_mod_productview_go">

						<?php if ($oProduct->rating > 0) { ?>
						<div class="wpsg_star_wrap">
							<?php for ($i = 0; $i < 5; $i ++) { ?><i class="fa fa-star <?php echo (($i >= $oProduct->rating)?'fa-star-active':''); ?>"></i><?php } ?>
						</div>
						<?php } ?>

						<div class="wpsg_center">
						
							<div class="wpsg_mod_productview_price_wrap">
								<?php $oldPrice = $oProduct->getOldPrice(); ?>							
								<?php if ($oldPrice !== false && $oldPrice != $oProduct->getPrice()) { ?>							
									<div class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></div>
									<div class="wpsg_mod_productview_current"><?php echo wpsg_ff($oProduct->getPrice(), $this->get_option('wpsg_currency')); ?></div>														
								<?php } else { ?>
									<div class="wpsg_mod_productview_price"><?php echo wpsg_ff($oProduct->getPrice(), $this->get_option('wpsg_currency')); ?></div>
								<?php } ?>
							</div>
							
							<div class="wpsg_mod_productview_tax_wrap">
								<?php if ($this->getFrontendTaxview() == WPSG_BRUTTO) { ?>
								<?php echo wpsg_translate(__('inkl. #1#% MwSt. zzgl. <a href="#2">Versandkosten</a>', 'wpsg'), $oProduct->getFrontendTaxValue(), $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)); ?>
								<?php } else if ($this->getFrontendTaxview() == WPSG_NETTO) { ?>
								<?php echo wpsg_translate(__('zzgl. #1#% MwSt. zzgl. <a href="#2">Versandkosten</a>', 'wpsg'), $oProduct->getFrontendTaxValue(), $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)); ?>
								<?php } ?>
							</div>
							
						</div>									
					</div>
															
				</div>
				
				<?php } } ?>
				
				<div class="wpsg_mod_productview_bottom">
				
					<div class="wpsg_mod_productview_name">				
						<h2><?php echo $oProduct->getProductName(); ?></h2>				
					</div>
					
					<div class="wpsg_mod_productview_description">
						<?php echo $oProduct->shortdesc; ?>
					</div>
					
					<a class="wpsg_mod_productview_button" href="<?php echo $oProduct->getProductURL(); ?>"><?php echo __('Zum Produkt', 'wpsg'); ?><span class="fa fa-angle-double-right"></span></a>
					 					
				</div>
												
			</div>
			
			<?php if ($i % $this->view['wpsg_mod_productview']['cols'] === 0) { ?>
			<div class="clearfix visible-lg-block"></div>
			<?php } ?>
			
			<?php } ?>
			
		<?php } else { ?>
		<div class="col-lg-12"><?php echo __('Keine Produkte in dieser Ansicht.', 'wpsg'); ?></div>
		<?php } ?>
		
		<div class="clearfix"></div>
		
		<?php if (wpsg_isSizedInt($this->view['wpsg_mod_productview']['pages']) && $this->view['wpsg_mod_productview']['pages'] > 1) { ?>
		<div class="wpsg_productview_pager">
			<div class="wpsg_productview_pager_wrap">
				<?php if ($this->view['wpsg_mod_productview']['page'] > 1) { ?>			
				<a href="#" title="<?php echo wpsg_translate(__('Eine Seite zurück und die vorherigen #1# Produkte anzeigen', 'wpsg'), $this->view['wpsg_mod_productview']['per_page']); ?>" onclick="return wpsg_switchProductview(<?php echo $this->view['wpsg_mod_productview']['index']; ?>, <?php echo $this->view['wpsg_mod_productview']['page'] - 1; ?>);"><span class="glyphicon glyphicon-arrow-left"></span></a>
				<?php } ?>
				<?php for ($i = 1; $i <= $this->view['wpsg_mod_productview']['pages']; $i ++) { ?>
					<?php if ($i == $this->view['wpsg_mod_productview']['page']) { ?>
					<span><?php echo $i; ?></span>
					<?php } else { ?>
					<a onclick="return wpsg_switchProductview(<?php echo $this->view['wpsg_mod_productview']['index']; ?>, <?php echo $i; ?>); " href="#"><?php echo $i; ?></a>
					<?php } ?>
				<?php } ?>
				<?php if ($this->view['wpsg_mod_productview']['page'] < $this->view['wpsg_mod_productview']['pages']) { ?>			
				<a href="#" title="<?php echo wpsg_translate(__('Eine Seite vor und die nächsten #1# Produkte anzeigen', 'wpsg'), $this->view['wpsg_mod_productview']['per_page']); ?>" onclick="return wpsg_switchProductview(<?php echo $this->view['wpsg_mod_productview']['index']; ?>, <?php echo $this->view['wpsg_mod_productview']['page'] + 1; ?>); "><span class="glyphicon glyphicon-arrow-right"></span></a>
				<?php } ?>
			</div>
		</div>
		<?php } ?>
	
	</div>

</div>