Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
2782 daniel 1
<?php
2
 
3
	/**
4
	 * Template für den Bestellablauf auf einer Seite
5
	 */
6149 hartmut 6
 
2782 daniel 7
?>
3448 daniel 8
<div class="wpsg wpsg_onepagecheckout wpsg_checkout wpsg_checkout2 <?php echo ((isset($_REQUEST['wpsg_basket_ajax']))?'wpsg_basket_ajax':''); ?>">
2782 daniel 9
 
10
	<?php echo $this->writeFrontendMessage(); ?>
2791 daniel 11
 
6149 hartmut 12
	<?php if ($this->get_option('wpsg_mod_onepagecheckout_basket') == 0) { ?>
13
		<?php $GLOBALS['step'] = 2; $this->render(WPSG_PATH_VIEW.'/warenkorb/progress.phtml'); ?>
14
	<?php } ?>
2791 daniel 15
	<form id="wpsg_basket_form" name="wpsg_basket_form"  method="post" action="<?php echo $this->getURL(wpsg_ShopController::URL_BASKET); ?>" enctype="multipart/form-data">
6149 hartmut 16
 
17
		<?php if ($this->get_option('wpsg_mod_onepagecheckout_basket') == 1) { ?>
18
			<?php $this->view['noFormTag'] = true; $this->render(WPSG_PATH_VIEW.'/warenkorb/basket.phtml'); ?>
19
		<?php } ?>
5010 daniel 20
 
2783 daniel 21
		<div class="wpsg_clear"></div>
2782 daniel 22
 
6149 hartmut 23
		<?php /* Einbindung des Logins im Checkout */ ?>
2782 daniel 24
		<?php $this->callMod('wpsg_mod_kundenverwaltung', 'checkout_login'); ?>
25
 
2792 daniel 26
		 <div class="wpsg_box" id="wpsg_box_payship">
3455 daniel 27
 
2792 daniel 28
		 	<div class="wpsg_inner">
29
 
6149 hartmut 30
		 		<?php if ($this->get_option('wpsg_mod_onepagecheckout_basket') == 0) { ?>
3455 daniel 31
		 		<div class="wpsg_shipping">
32
 
5140 daniel 33
		 			<h2><?php echo __('Versandarten', 'wpsg'); ?></h2>
3460 daniel 34
 
5140 daniel 35
		 			<div class="shippay_wrap">
36
		 				<?php foreach ($this->view['arShipping'] as $s) { ?>
37
		 				<div class="shippay_item_wrap">
38
 
39
							<input <?php echo (($this->view['basket']['checkout']['shipping'] == $s['id'] || sizeof($this->view['arShipping']) == 1)?'checked="checked"':''); ?> type="radio" value="<?php echo $s['id']; ?>" name="wpsg[checkout][shipping]" id="shipping_<?php echo $s['id']; ?>" />
40
 
41
		 					<?php if (wpsg_isSizedString($s['logo'])) { ?>
42
							<img class="wpsg_payship_logo" src="<?php echo $s['logo']; ?>" alt="<?php echo $s['name']; ?>" />
43
							<?php } else { ?>
44
							<div class="wpsg_payship_name"><?php echo __($s['name'], 'wpsg'); ?></div>
45
							<?php } ?>
46
		 					<?php if ((isset($s['hint']) && trim($s['hint']) != '') || $s['price'] > 0) { ?>
47
							<div id="shipping_<?php echo $s['id']; ?>_hint" class="shippay_hint">
48
								<?php if ($s['price'] > 0) { ?>
49
								<?php echo __('Gebühr', 'wpsg'); ?>: <?php echo wpsg_ff($s['price'], $this->get_option('wpsg_currency')); ?><br />
2792 daniel 50
								<?php } ?>
5140 daniel 51
								<?php echo $this->replaceUniversalPlatzhalter(__($s['hint'], 'wpsg')); ?>
3455 daniel 52
							</div>
5140 daniel 53
							<?php } ?>
54
 
55
							<div class="shippay_checkmark"></div>
56
 
57
		 				</div>
58
		 				<?php } ?>
59
		 			</div>
60
 
2792 daniel 61
				</div>
6149 hartmut 62
				<?php } ?>
2792 daniel 63
 
5010 daniel 64
				<?php if ($this->callMods('checkout_handlePayment') === true) { ?>
2792 daniel 65
 
5010 daniel 66
					<?php if (!$this->hasMod('wpsg_mod_crefopay')) { ?>
6149 hartmut 67
					<?php if ($this->get_option('wpsg_mod_onepagecheckout_basket') == 0) { ?>
5010 daniel 68
					<div class="wpsg_payment">
3460 daniel 69
 
5010 daniel 70
						<h2><?php echo __('Zahlungsarten', 'wpsg'); ?></h2>
71
 
5140 daniel 72
						<div class="shippay_wrap">
73
		 				<?php foreach ($this->view['arPayment'] as $p) { ?>
74
		 				<div class="shippay_item_wrap">
75
 
76
							<input <?php echo (($this->view['basket']['checkout']['payment'] == $p['id'] || sizeof($this->view['arPayment']) == 1)?'checked="checked"':''); ?> type="radio" value="<?php echo $p['id']; ?>" name="wpsg[checkout][payment]" id="payment_<?php echo $p['id']; ?>" />
77
 
78
		 					<div class="wpsg_payship_name"><?php echo __($p['name'], 'wpsg'); ?></div>
79
 
80
		 					<?php if (wpsg_isSizedString($p['logo'])) { ?>
81
							<img class="wpsg_payship_logo" src="<?php echo $p['logo']; ?>" alt="<?php echo $p['name']; ?>" />
82
							<?php } ?>
83
 
6142 hartmut 84
		 					<?php if ((isset($p['hint']) && trim($p['hint']) != '') || $p['preis'] > 0) { ?>
5140 daniel 85
							<div id="payment_<?php echo $p['id']; ?>_hint" class="shippay_hint">
6142 hartmut 86
								<?php if ($p['preis'] > 0) { ?>
87
								<?php echo __('Gebühr', 'wpsg'); ?>: <?php echo wpsg_ff($p['preis'], $this->get_option('wpsg_currency')); ?><br />
5140 daniel 88
								<?php } ?>
89
								<?php echo $this->replaceUniversalPlatzhalter(__($p['hint'], 'wpsg')); ?>
3455 daniel 90
							</div>
5010 daniel 91
							<?php } ?>
5140 daniel 92
 
93
							<div class="shippay_checkmark"></div>
94
 
95
		 				</div>
96
		 				<?php } ?>
6149 hartmut 97
		 				</div>
2792 daniel 98
 
5010 daniel 99
					</div>
100
					<?php } ?>
6149 hartmut 101
					<?php } ?>
5010 daniel 102
 
4323 daniel 103
				<?php } ?>
5010 daniel 104
 
2792 daniel 105
		 		<div class="wpsg_clear"></div>
106
 
107
		 	</div>
108
 
109
		 </div>
110
 
111
		<div class="wpsg_box" id="wpsg_box_kundendaten">
112
 
3448 daniel 113
			<h2><?php echo __('Kundendaten', 'wpsg'); ?></h2>
3460 daniel 114
 
115
			<div class="wpsg_spacer"></div>
116
 
2783 daniel 117
			<div class="wpsg_inner">
2782 daniel 118
 
2783 daniel 119
				<div class="wpsg_checkoutblock">
120
					<label for="wpsg_firma"><?php echo __("Firma", "wpsg"); ?>
121
					<?php if ($this->view['pflicht']['firma'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
122
					</label>
123
					<input class="<?php echo (($this->view['pflicht']['firma'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("firma", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_firma" name="wpsg[checkout][firma]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['firma']); ?>" />
124
				</div>
125
 
126
				<div class="wpsg_checkoutblock">
127
					<label for="wpsg_title"><?php echo __('Anrede', 'wpsg'); ?>
128
					<?php if ($this->view['pflicht']['anrede'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:</label>
129
					<select class="<?php echo (($this->view['pflicht']['anrede'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("title", (array)$this->view['error']))?'wpsg_error':''); ?>" id="wpsg_title" name="wpsg[checkout][title]">
130
						<option value="-1"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
6107 hartmut 131
						<?php $i=0; foreach (explode("|", $this->view['pflicht']['anrede_auswahl']) as $t) { ?>
132
						<option value="<?php echo $i; /*wpsg_hspc($t);*/ $i++; ?>" <?php echo (($this->view['basket']['checkout']['title'] == $t)?'selected="selected"':''); ?>><?php echo $t; ?></option>
2783 daniel 133
					<?php } ?>
134
					</select>
135
				</div>
136
 
137
				<div class="wpsg_checkoutblock">
138
					<label for="vname" class="wpsg_checkout"><?php echo __("Vorname", "wpsg"); ?>
139
					<?php if ($this->view['pflicht']['vname'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
140
					</label>
141
					<input class="<?php echo (($this->view['pflicht']['vname'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("vname", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="vname" name="wpsg[checkout][vname]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['vname']); ?>" />
142
				</div>
2782 daniel 143
 
2783 daniel 144
				<div class="wpsg_checkoutblock">
145
					<label for="name" class="wpsg_checkout"><?php echo __("Name", "wpsg"); ?>
6142 hartmut 146
					<?php if ($this->view['pflicht']['name'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
2783 daniel 147
					</label>
148
					<input class="<?php echo (($this->view['pflicht']['name'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("name", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="name" name="wpsg[checkout][name]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['name']); ?>" />
149
				</div>
150
 
151
				<div class="wpsg_checkoutblock">
152
					<label for="email" class="wpsg_checkout"><?php echo __("E-Mail Adresse", "wpsg"); ?>
153
					<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
154
					</label>
4904 daniel 155
					<input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email" name="wpsg[checkout][email]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['email']); ?>" />
2783 daniel 156
				</div>
157
 
158
				<?php if (isset($this->view['pflicht']['emailconfirm']) && $this->view['pflicht']['emailconfirm'] == '1') { ?>
159
				<div class="wpsg_checkoutblock">
3459 daniel 160
					<label for="email" class="wpsg_checkout"><?php echo __("E-Mail (Wiederholung)", "wpsg"); ?>
2783 daniel 161
					<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
162
					</label>
4904 daniel 163
					<input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email2" name="wpsg[checkout][email2]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['email2']); ?>" />
2783 daniel 164
				</div>
2782 daniel 165
				<?php } ?>
2783 daniel 166
 
167
				<div class="wpsg_checkoutblock">
4940 daniel 168
					<label for="geb" class="wpsg_checkout"><?php echo __('Geburtsdatum (Format: TT.MM.JJJJ)',"wpsg"); ?>
2783 daniel 169
					<?php if ($this->view['pflicht']['geb'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
170
					</label>
4941 daniel 171
					<input class="wpsg_input_text <?php echo (($this->view['pflicht']['geb'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("geb", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="geb" name="wpsg[checkout][geb]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['geb']); ?>" />
2783 daniel 172
				</div>
173
 
174
				<div class="wpsg_checkoutblock">
175
					<label for="fax" class="wpsg_checkout"><?php echo __("Fax.", "wpsg"); ?>
176
					<?php if ($this->view['pflicht']['fax'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
177
					</label>
4904 daniel 178
					<input class="wpsg_input_text <?php echo (($this->view['pflicht']['fax'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("fax", (array)$this->view['error']))?'wpsg_error':''); ?>" type="tel" id="fax" name="wpsg[checkout][fax]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['fax']); ?>" />
2783 daniel 179
				</div>
180
 
181
				<div class="wpsg_checkoutblock">
182
					<label for="tel" class="wpsg_checkout"><?php echo __("Tel.", "wpsg"); ?>
183
					<?php if ($this->view['pflicht']['tel'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
184
					</label>
4904 daniel 185
					<input class="wpsg_input_text <?php echo (($this->view['pflicht']['tel'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("tel", (array)$this->view['error']))?'wpsg_error':''); ?>" type="tel" id="tel" name="wpsg[checkout][tel]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['tel']); ?>" />
2783 daniel 186
				</div>
2782 daniel 187
 
2783 daniel 188
				<div class="wpsg_checkoutblock">
6053 hartmut 189
					<label for="strasse" class="wpsg_checkout"><?php echo __("Straße Nr.", "wpsg"); ?>
2783 daniel 190
					<?php if ($this->view['pflicht']['strasse'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
191
					</label>
192
					<input class="<?php echo (($this->view['pflicht']['strasse'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("strasse", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="strasse" name="wpsg[checkout][strasse]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['strasse']); ?>" />
193
				</div>
194
 
195
				<div class="wpsg_checkoutblock">
196
					<label for="plz" class="wpsg_checkout"><?php echo __("Postleitzahl", "wpsg"); ?>
197
					<?php if ($this->view['pflicht']['plz'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
198
					</label>
5382 daniel 199
					<input class="wpsg_input_text <?php echo (($this->view['pflicht']['plz'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("plz", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="plz" name="wpsg[checkout][plz]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['plz']); ?>" />
2783 daniel 200
				</div>
201
 
202
				<div class="wpsg_checkoutblock">
203
					<label for="ort" class="wpshopgermany_checkout"><?php echo __("Ort", "wpsg"); ?>
204
					<?php if ($this->view['pflicht']['ort'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
205
					</label>
206
					<input class="<?php echo (($this->view['pflicht']['ort'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ort", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="ort" name="wpsg[checkout][ort]" value="<?php echo htmlspecialchars($this->view['basket']['checkout']['ort']); ?>" />
207
				</div>
208
 
6149 hartmut 209
				<?php
210
					$lhidden = '';
211
					if ($this->hasMod('wpsg_mod_onepagecheckout') && ($this->get_option('wpsg_mod_onepagecheckout_basket') == 1 )) {
212
						$lhidden = 'hidden="hidden"';
213
					}
214
				?>
215
 
216
				<div class="wpsg_checkoutblock" <?php echo $lhidden;?>>
2783 daniel 217
					<label for="wpsg_land" class="wpsg_checkout"><?php echo __("Land", "wpsg"); ?>
218
					<?php if ($this->view['pflicht']['land'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
219
					</label>
220
					<select name="wpsg[checkout][land]" class="<?php echo (($this->view['pflicht']['land'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("land", (array)$this->view['error']))?'wpsg_error':''); ?>" id="wpsg_land">
221
						<option value="-1"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
222
						<?php foreach ($this->view['laender'] as $l) { ?>
3426 daniel 223
						<option value="<?php echo wpsg_hspc($l['id']); ?>" <?php echo (($l['id'] == $this->view['basket']['checkout']['land'])?'selected="selected"':(($this->get_option('wpsg_defaultland') == $l['id'])?'selected="selected"':'')); ?>><?php echo wpsg_hspc(__($l['name'], 'wpsg')); ?></option>
2783 daniel 224
						<?php } ?>
225
					</select>
226
				</div>
227
 
228
				<div class="wpsg_checkoutblock">
229
					<label for="wpsg_ustidnr" class="wpshopgermany_checkout"><?php echo __("UStIdNr.", "wpsg"); ?>
230
					<?php if ($this->view['pflicht']['ustidnr'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
231
					</label>
6142 hartmut 232
					<input class="<?php echo (($this->view['pflicht']['ustidnr'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("ustidnr", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_ustidnr" name="wpsg[checkout][ustidnr]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['ustidnr'])); ?>" />
2783 daniel 233
				</div>
234
 
235
				<?php /* Automatische Einbindung der benutzerdefinierten Felder */ ?>
236
				<?php if ($this->get_option('wpsg_kundenvariablen_show') == '1') { ?>
237
				<?php foreach ((array)$this->view['pflicht']['custom'] as $c_id => $c) { if ($c['show'] != '2') { ?>
238
				<div class="wpsg_checkoutblock">
239
					<label class="wpsg_cv" for="wpsg_cv_<?php echo $c_id; ?>">
240
						<?php echo wpsg_hspc(__($c['name'], 'wpsg')); ?><?php if ($c['show'] == '0') { ?> <span class="wpsg_required">*</span><?php } ?>:
241
						<?php if ($c['typ'] == '0') { // Textfeld ?>
6803 hartmut 242
						<input class="<?php echo (($c['show'] == '0')?'validate[required]':''); ?> <?php echo ((in_array("custom_".$c_id, (array)$this->view['error']))?'wpsg_error':''); ?>" name="wpsg[checkout][custom][<?php echo $c_id; ?>]" type="text" value="<?php if (isset($this->view['basket']['checkout']['custom'][$c_id])) echo wpsg_hspc($this->view['basket']['checkout']['custom'][$c_id]); ?>" />
2783 daniel 243
						<?php } else if ($c['typ'] == '1') { $arAuswahl = explode("|", $c['auswahl']); // Auswahlfeld ?>
244
						<select class="<?php echo (($c['show'] == '0')?'validate[required]':''); ?> <?php echo ((in_array("custom_".$c_id, (array)$this->view['error']))?'wpsg_error':''); ?>" name="wpsg[checkout][custom][<?php echo $c_id; ?>]">
245
							<option value="-1"><?php echo __('Bitte Auswählen', 'wpsg'); ?></option>
246
							<?php foreach ((array)$arAuswahl as $a) { ?>
6803 hartmut 247
							<option value="<?php echo wpsg_hspc($a); ?>" <?php if (isset($this->view['basket']['checkout']['custom'][$c_id])) echo (($a == $this->view['basket']['checkout']['custom'][$c_id])?'selected="selected"':''); ?>><?php echo wpsg_hspc($a); ?></option>
2783 daniel 248
							<?php } ?>
249
						</select>
250
						<?php } else if ($c['typ'] == '2') { // Checkbox ?>
251
						<input type="hidden" name="wpsg[checkout][custom][<?php echo $c_id; ?>]" value="0" />
6803 hartmut 252
						<input class="<?php echo (($c['show'] == '0')?'validate[required]':''); ?> checkbox" type="checkbox" value="1" name="wpsg[checkout][custom][<?php echo $c_id; ?>]" value="1" <?php if(isset($this->view['basket']['checkout']['custom'][$c_id])) echo wpsg_hspc(($this->view['basket']['checkout']['custom'][$c_id] == '1')?'checked="checked"':''); ?> />
2783 daniel 253
						<?php } ?>
254
					</label>
255
				</div>
256
				<?php } } ?>
2782 daniel 257
				<?php } ?>
2783 daniel 258
				<?php /* Automatische Einbindung der benutzerdefinierten Kundenfelder ENDE */ ?>
259
 
2791 daniel 260
				<div class="wpsg_clear"></div>
261
 
262
				<?php $this->callMods('checkout_customer_inner'); ?>
2783 daniel 263
 
264
			</div>
265
 
2782 daniel 266
		</div>
2783 daniel 267
 
2782 daniel 268
		<?php $this->callMods('checkout_inner_prebutton', array(&$this->view)); ?>
269
 
270
		<div class="wpsg_clear"></div>
2783 daniel 271
 
272
		<div class="wpsg_box">
3460 daniel 273
 
3448 daniel 274
			<h2><?php echo __('Bestellkommentar', 'wpsg'); ?></h2>
3460 daniel 275
 
276
			<div class="wpsg_spacer"></div>
277
 
2783 daniel 278
			<div class="wpsg_inner wpsg_commentblock">
3432 daniel 279
				<textarea name="wpsg[checkout][comment]" id="wpsg_checkout_comment"><?php echo wpsg_hspc($this->view['basket']['checkout']['comment']); ?></textarea>
2783 daniel 280
			</div>
2782 daniel 281
		</div>
282
 
283
		<div class="wpsg_mandatoryfield_hint">
284
			<?php echo wpsg_translate(__('Mit #1# gekennzeichnete Felder sind Pflichtfelder.', 'wpsg'), '<span class="wpsg_required">*</span>'); ?>
285
		</div>
286
 
287
		<br />
288
 
289
		<?php $this->ClearSessionErrors(); ?>
290
 
291
		<br />
292
 
6149 hartmut 293
		<?php if ($this->get_option('wpsg_mod_onepagecheckout_basket') == 0) { ?>
2791 daniel 294
		<input type="submit" onclick="location.href='<?php echo $this->getURL(wpsg_ShopController::URL_BASKET); ?>'; return false;" class="wpsg_button wpsg_basketbutton" value="<?php echo __('Zurück zum Warenkorb', 'wpsg'); ?>" name="wpsg_redirect_basket" />
6149 hartmut 295
		<?php } ?>
3647 daniel 296
		<input type="submit" id="wpsg_checkout2button" class="wpsg_button wpsg_checkout2button" value="<?php echo __('Weiter', 'wpsg'); ?>" name="wpsg_checkout" />
2782 daniel 297
 
2866 daniel 298
		<div class="wpsg_clear"></div>
299
 
2782 daniel 300
		<br />
301
 
302
	</form>
303
 
304
	<script type="text/javascript">/* <![CDATA[ */
5140 daniel 305
 
306
		function wpsg_setShipPay(jqElement)
307
		{
308
 
309
			jqElement.parents('.shippay_wrap').find('.shippay_item_wrap').removeClass('shippay_active');
310
			jqElement.addClass('shippay_active');
311
 
312
			jqElement.find('input').prop('checked', true);
313
 
314
			return true;
315
 
316
		}
2791 daniel 317
 
2782 daniel 318
		jQuery(document).ready(function() {
2791 daniel 319
 
5140 daniel 320
			jQuery('.shippay_wrap .shippay_item_wrap').bind('click', function() {
321
 
322
				wpsg_setShipPay(jQuery(this));
323
 
324
				jQuery.ajax( {
325
					'url': wpsg_ajax.ajaxurl,
326
					'method': 'get',
327
					'data': {
328
						'wpsg[action]': 'updateCheckout',
329
						'wpsg_form_data': jQuery('#wpsg_checkout_form').serialize()
330
					},
331
					'async': true,
332
					'success': function(data) { }
333
				} );
334
 
335
			} );
336
 
337
			jQuery('.shippay_wrap .shippay_item_wrap').each(function() {
338
 
339
				if (jQuery(this).find('input[type="radio"]').prop('checked')) wpsg_setShipPay(jQuery(this));
340
 
341
			} );
342
 
3647 daniel 343
			jQuery('#wpsg_box_kundendaten input').bind('keypress', function(e) {
344
 
345
				if(e.keyCode == 13)
346
			    {
347
 
348
			        jQuery('#wpsg_checkout2button').click();
349
			        return false;
350
 
351
			    }
352
 
353
			} );
354
 
3455 daniel 355
			jQuery('.shippay input[type="radio"]').bind('change', function() {
356
 
357
				jQuery(this).parents('.shippay_wrap').find('.shippay').removeClass('wpsg_hover');
358
 
359
				if (jQuery(this).prop("checked"))
360
				{
361
 
362
					jQuery(this).parents('.shippay').addClass('wpsg_hover');
363
 
364
				}
3589 daniel 365
 
3457 daniel 366
				wpsg_showPaymentHint();
4126 daniel 367
				wpsg_showShippingHint();
3455 daniel 368
 
369
			} );
370
 
371
			jQuery('.shippay input[type="radio"]:checked').change();
372
			jQuery('.shippay').bind('click', function(e) {
373
 
3589 daniel 374
				if (jQuery(this).hasClass('wpsg_hover')) return true;
3523 daniel 375
 
3455 daniel 376
				jQuery(this).find('input[type="radio"]').attr("checked", "checked");
377
				jQuery(this).find('input[type="radio"]').change();
378
 
379
			} );
380
 
2791 daniel 381
			<?php if ($this->get_option('wpsg_form_validation') == '1') { ?>
2782 daniel 382
			if (typeof jQuery.validationEngine == "object")
383
			{
384
 
3647 daniel 385
				jQuery("#wpsg_basket_form").validationEngine('attach', { promptPosition : "bottomLeft", scroll: false } );
386
 
387
				jQuery('.wpsg_mod_kundenverwaltung_login').bind('click', function() {
388
					jQuery("#wpsg_basket_form").validationEngine('detach');
389
				});
2782 daniel 390
 
391
			}
2791 daniel 392
			<?php } else if ($this->get_option('wpsg_form_validation') == '2') { ?>
393
 
394
			jQuery.validator.addMethod("cRequired", jQuery.validator.methods.required, "<?php echo __('Dieses Feld ist ein Pflichtfeld.', 'wpsg'); ?>");
395
			jQuery.validator.addClassRules('validate[required]', { cRequired: true } );
396
			jQuery("#wpsg_basket_form").validate( {
397
				ignore: '',
398
				errorClass: 'wpsg_error',
399
				onsubmit: false,
400
				showErrors: function(errorMap, errorList) {
2783 daniel 401
 
2791 daniel 402
					this.defaultShowErrors();
403
					var errors = this.numberOfInvalids();
404
 
405
				}
406
			} );
407
 
2868 daniel 408
			jQuery('.wpsg_checkout2button').bind('click', function() {
3021 daniel 409
 
410
				var bReturn = jQuery('#wpsg_basket_form').validate().form();
411
				if (jQuery('#wpsg_basket_form input.wpsg_error').length > 0) jQuery('#wpsg_basket_form input.wpsg_error')[0].focus();
412
				return bReturn;
413
 
2783 daniel 414
			} );
2791 daniel 415
 
3647 daniel 416
			<?php } ?>
6149 hartmut 417
 
6803 hartmut 418
			land = <?php if (wpsg_isSizedInt($this->view['basket']['checkout']['land'])) echo $this->view['basket']['checkout']['land'];
419
					else echo $this->get_option('wpsg_defaultland'); ?>;
420
 
6149 hartmut 421
			// Land der Rechnungsadresse setzen
6803 hartmut 422
			//land = jQuery('#set_land').val();
6149 hartmut 423
			jQuery('#wpsg_land').val(land);
424
			//alert('land: ' + land);
3448 daniel 425
 
2782 daniel 426
		} );
427
 
428
	/* ]]> */</script>
5382 daniel 429
 
2782 daniel 430
</div>