summaryrefslogtreecommitdiff
path: root/views/mods/mod_shippingadress/checkout_inner_prebutton.phtml
blob: 03adbe5eae96637118bb97ab2bdd73f23a23cb77 (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
<div class="wpsg_mod_shippingadress">

	<h2><?php echo __('Gesonderte Lieferadresse', 'wpsg'); ?></h2>
	
	<div class="wpsg_spacer"></div>
	
	<div class="wpsg_inner">
	
		<div class="wpsg_checkoutblock">
			<label for="act_checkout_shippingadress">
				<input id="act_checkout_shippingadress" class="wpsg_checkout formfield_checkbox" type="checkbox" name="wpsg[checkout][diff_shippingadress]" value="" <?php echo ((wpsg_isSizedInt($_SESSION['wpsg']['checkout']['diff_shippingadress']))?'checked="checked"':'') ?> onclick="view_checkout_shippingadresss()" />
				<?php echo __('Gesonderte Lieferadresse abweichend von der Rechnungsadresse verwenden', 'wpsg') ?>
			</label>			
		</div>
		
		<div class="wpsg_clear"></div>
		
		<div class="checkout_shippingadress" style="display:none;"> 
		
			<?php if ($this->view['pflicht']['firma'] != '2') { ?>
			<div class="wpsg_checkoutblock">
				<label for="shipping_firma" class="wpsg_checkout"><?php echo __("Firma:", "wpsg"); ?>
					<?php if ($this->view['pflicht']['firma'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
				</label>
				<input class="<?php echo (($this->view['pflicht']['firma'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("name", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="shipping_name" name="wpsg[checkout][shipping_firma]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['basket']['checkout']['shipping_firma'])); ?>" />
			</div>
			<?php } ?>
		
			<?php if ($this->view['pflicht']['anrede'] != '2') { ?>
			<div class="wpsg_checkoutblock">
				<label for="shipping_title" class="wpsg_checkout"><?php echo __("Anrede:", "wpsg"); ?>
					<?php if ($this->view['pflicht']['anrede'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
				</label>
				<select class="<?php echo (($this->view['pflicht']['anrede'] != '1')?'validate[required_shipping]':''); ?> wpsg_checkout <?php echo ((in_array("title", (array)$this->view['error']))?'wpsg_error':''); ?>" type="select" id="shipping_title" name="wpsg[checkout][shipping_title]">
				<option value="-1"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
				<?php $i=0; foreach (explode("|", $this->view['pflicht']['anrede_auswahl']) as $t) { ?>
				<option value="<?php echo $i; /*wpsg_hspc($t);*/ ?>" <?php echo ((($this->view['basket']['checkout']['shipping_title']??'') === strval($i))?'selected="selected"':''); ?>><?php echo $t; ?></option>
				<?php $i++; } ?>
				</select>
			</div>
			<?php } ?>
			
			<?php if ($this->view['pflicht']['vname'] != '2') { ?>
			<div class="wpsg_checkoutblock">
				<label for="shipping_vname" class="wpsg_checkout"><?php echo __("Vorname:", "wpsg"); ?>
					<?php if ($this->view['pflicht']['vname'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
				</label>
				<input class="<?php echo (($this->view['pflicht']['vname'] != '1')?'validate[required_shipping]':''); ?> wpsg_checkout <?php echo ((in_array("shipping_vname", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="shipping_vname" name="wpsg[checkout][shipping_vname]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['basket']['checkout']['shipping_vname'])); ?>" />
			</div>
			<?php } ?>
				
			<?php if ($this->view['pflicht']['name'] != '2') { ?>
			<div class="wpsg_checkoutblock">
				<label for="shipping_name" class="wpsg_checkout"><?php echo __("Name:", "wpsg"); ?>
					<?php if ($this->view['pflicht']['name'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
				</label>
				<input class="<?php echo (($this->view['pflicht']['name'] != '1')?'validate[required_shipping]':''); ?> wpsg_checkout <?php echo ((in_array("shipping_name", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="shipping_name" name="wpsg[checkout][shipping_name]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['basket']['checkout']['shipping_name'])); ?>" />
			</div>
			<?php } ?>
				
			<?php if ($this->view['pflicht']['strasse'] != '2') { ?>
				
				<?php if ($this->view['pflicht']['wpsg_showNr'] === '1') { ?>

					<div class="wpsg_checkoutblock" id="wpsg_streetnr">
						<label for="shipping_strasse" class="street wpsg_checkout"><?php echo __('Straße:', 'wpsg'); ?>
							<?php if ($this->view['pflicht']['strasse'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
							<input class="<?php echo (($this->view['pflicht']['strasse'] != '1')?'validate[required_shipping]':''); ?> wpsg_checkout <?php echo ((in_array("shipping_strasse", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="shipping_strasse" name="wpsg[checkout][shipping_strasse]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['shipping_strasse'])); ?>" />
						</label>
						<label for="shipping_nr" class="nr wpsg_checkout"><?php echo __('Nr:', 'wpsg'); ?>
							<?php if ($this->view['pflicht']['strasse'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
							<input class="<?php echo (($this->view['pflicht']['strasse'] != '1')?'validate[required_shipping]':''); ?> wpsg_checkout <?php echo ((in_array("shipping_nr", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="shipping_nr" name="wpsg[checkout][shipping_nr]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['shipping_nr'])); ?>" />
						</label>
					</div>
				
				<?php } else { ?>

					<div class="wpsg_checkoutblock">
						<label for="shipping_strasse" class="wpsg_checkout"><?php echo __("Straße, Nr.:", "wpsg"); ?>
							<?php if ($this->view['pflicht']['strasse'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
						</label>
						<input class="<?php echo (($this->view['pflicht']['strasse'] != '1')?'validate[required_shipping]':''); ?> wpsg_checkout <?php echo ((in_array("shipping_strasse", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="shipping_strasse" name="wpsg[checkout][shipping_strasse]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['basket']['checkout']['shipping_strasse'])); ?>" />
					</div>
				
				<?php } ?> 
				
			<?php } ?>
						
			<?php if ($this->view['pflicht']['plz'] != '2') { ?>
			<div class="wpsg_checkoutblock">
				<label for="shipping_plz" class="wpsg_checkout"><?php echo __("Postleitzahl:", "wpsg"); ?> 
					<?php if ($this->view['pflicht']['plz'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
				</label>
				<input class="<?php echo (($this->view['pflicht']['plz'] != '1')?'validate[required_shipping]':''); ?> wpsg_checkout <?php echo ((in_array("shipping_plz", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="shipping_plz" name="wpsg[checkout][shipping_plz]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['basket']['checkout']['shipping_plz'])); ?>" />
			</div>
			<?php } ?>
				
			<?php if ($this->view['pflicht']['ort'] != '2') { ?>
			<div class="wpsg_checkoutblock">
				<label for="shipping_ort" class="wpshopgermany_checkout"><?php echo __("Ort:", "wpsg"); ?> 
					<?php if ($this->view['pflicht']['ort'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
				</label>
				<input class="<?php echo (($this->view['pflicht']['ort'] != '1')?'validate[required_shipping]':''); ?> wpsg_checkout <?php echo ((in_array("shipping_ort", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="shipping_ort" name="wpsg[checkout][shipping_ort]" value="<?php echo wpsg_hspc(wpsg_getStr($this->view['basket']['checkout']['shipping_ort'])); ?>" />
			</div>
			<?php } ?>
				
			<?php if ($this->view['pflicht']['land'] != '2') { ?>
			<div class="wpsg_checkoutblock">
				<label for="shipping_land" class="wpsg_checkout"><?php echo __("Land:", "wpsg"); ?>
					<?php if ($this->view['pflicht']['land'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
				</label>				
				<select name="wpsg[checkout][shipping_land]" class="<?php echo (($this->view['pflicht']['land'] != '1')?'validate[required_shipping]':''); ?> wpsg_checkout <?php echo ((in_array("shipping_land", (array)$this->view['error']))?'wpsg_error':''); ?>" id="shipping_land">
					<option value="-1"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
					<?php foreach ($this->view['laender'] as $l) { ?>
					<option value="<?php echo $l['id']; ?>" <?php echo (($l['id'] == $this->view['basket']['checkout']['shipping_land'])?'selected="selected"':''); ?>><?php echo wpsg_hspc($l['name']); ?></option>
					<?php } ?>
				</select>
			</div>
			<?php } ?>
		 
			<script type="text/javascript">/* <![CDATA[ */
					
				function view_checkout_shippingadresss()
				{
			 
					if (jQuery('#act_checkout_shippingadress').prop('checked') != true)
					{
						
						jQuery('.checkout_shippingadress').attr('style', 'display:none;');
						jQuery('#act_checkout_shippingadress').attr('value', null);

						<?php if ($this->get_option('wpsg_form_validation') == '2') { ?>
						jQuery.validator.removeClassRules('validate[required_shipping]', { cRequired: true } );
						<?php } ?>
						
					}
			
					if (jQuery('#act_checkout_shippingadress').prop('checked') == true)
					{
						
						jQuery('.checkout_shippingadress').attr('style', 'display:display;');
						jQuery('#act_checkout_shippingadress').attr('value', 1);

						<?php if ($this->get_option('wpsg_form_validation') == '2') { ?>
						jQuery.validator.addClassRules('validate[required_shipping]', { cRequired: true } );
						<?php } ?>
						
					}	
					
					return false;
					
				}
		
				jQuery(document).ready(function()
				{	
					
					view_checkout_shippingadresss();

					land = <?php if (wpsg_isSizedInt($this->view['basket']['checkout']['shipping_land'])) echo $this->view['basket']['checkout']['shipping_land'];
					else echo $this->get_option('wpsg_defaultland'); ?>;
					jQuery('#shipping_land').val(land);
					
				});
				
			/* ]]> */</script>
		</div>
	</div>
</div>