summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--views/mods/mod_addressvalidation/addressvalidation.js413
-rw-r--r--views/mods/mod_addressvalidation/settings_edit.phtml60
-rw-r--r--views/warenkorb/checkout.phtml405
3 files changed, 597 insertions, 281 deletions
diff --git a/views/mods/mod_addressvalidation/addressvalidation.js b/views/mods/mod_addressvalidation/addressvalidation.js
index b74aa5b..089788b 100644
--- a/views/mods/mod_addressvalidation/addressvalidation.js
+++ b/views/mods/mod_addressvalidation/addressvalidation.js
@@ -1,82 +1,351 @@
/**
- * Globale Funktionen zur Adressvalidation
+ * Adressvalidierung im Browser
+ * Fragt wpsg_mod_addressvalidation::ajaxValidate() im Shop an, der API-Key bleibt auf dem Server
+ * Die Konfiguration (ajaxurl, action, nonce, labelApply, labelProposal) setzt wpsg_mod_addressvalidation::wpsg_enqueue_scripts()
*/
-function validateAddressBind(data) {
- jQuery(data.PLZ).on("input", function () {
- validateAddress(data);
- });
- jQuery(data.Ort).on("input", function () {
- validateAddress(data);
- });
- jQuery(data.Strasse).on("input", function () {
- validateAddress(data);
- });
- jQuery(data.Land).on("input", function () {
- validateAddress(data);
+/** Verzögerung, damit mehrere geänderte Felder nur eine Anfrage auslösen (ms) */
+var wpsg_mod_addressvalidation_delay = 400;
+
+/**
+ * Selektoren der Adressfelder je Adresse
+ * Klassische Kasse, OnePage, Profil und Registrierung (#strasse …) sowie SmartCheckout (#wpsg_sc_strasse …)
+ * Die Lieferanschrift (#shipping_…) ist in beiden gleich
+ */
+var wpsg_mod_addressvalidation_fields = [
+ {
+ type: 'billing',
+ strasse: '#strasse, #wpsg_sc_strasse',
+ nr: '#nr, #wpsg_sc_nr',
+ plz: '#plz, #wpsg_sc_plz',
+ ort: '#ort, #wpsg_sc_ort',
+ land: '#wpsg_land, #wpsg_sc_land'
+ },
+ {
+ type: 'shipping',
+ strasse: '#shipping_strasse',
+ nr: '#shipping_nr',
+ plz: '#shipping_plz',
+ ort: '#shipping_ort',
+ land: '#shipping_land'
+ }
+];
+
+/**
+ * Liefert das erste vorhandene Feld zu einem Schlüssel (strasse, nr, plz, ort, land)
+ *
+ * @param oFields
+ * @param strKey
+ * @return jQuery
+ */
+function wpsg_mod_addressvalidation_getField(oFields, strKey) {
+
+ return jQuery(oFields[strKey]).first();
+
+} // function wpsg_mod_addressvalidation_getField(oFields, strKey)
+
+/**
+ * Bindet die Prüfung an die Felder einer Adresse
+ * Über document, damit auch Felder greifen, die erst später erzeugt werden (SmartCheckout baut sie mit Vue auf)
+ *
+ * @param oFields Selektoren der Felder (strasse, nr, plz, ort, land) und type ('billing' oder 'shipping')
+ */
+function wpsg_mod_addressvalidation_bind(oFields) {
+
+ var oTimer = null;
+
+ jQuery(document).on('change', [oFields.strasse, oFields.nr, oFields.plz, oFields.ort, oFields.land].join(', '), function() {
+
+ window.clearTimeout(oTimer);
+
+ oTimer = window.setTimeout(function() {
+
+ wpsg_mod_addressvalidation_check(oFields);
+
+ }, wpsg_mod_addressvalidation_delay);
+
});
-}
-
-// Adress-Validation
-function validateAddress(data) {
- var
- plz,
- ort,
- strasse,
- astr1,
- land = 'de',
- rw;
- plz = jQuery(data.PLZ).val();
- ort = jQuery(data.Ort).val();
- strasse = jQuery(data.Strasse).val();
- nr = jQuery(data.Nr).val();
- if (nr !== undefined) {
- strasse = strasse + ' ' + nr;
+
+} // function wpsg_mod_addressvalidation_bind(oFields)
+
+/**
+ * Liefert das Element für die Meldung einer Adresse und legt es bei Bedarf direkt hinter dem Land an
+ * (ohne Land hinter Ort bzw. PLZ)
+ *
+ * @param oFields
+ * @return jQuery
+ */
+function wpsg_mod_addressvalidation_getMessage(oFields) {
+
+ var strClass = 'wpsg_mod_addressvalidation_message_' + oFields.type;
+ var oMessage = jQuery('.' + strClass);
+
+ if (oMessage.length) return oMessage;
+
+ oMessage = jQuery('<div class="wpsg_mod_addressvalidation_message ' + strClass + '" role="status"></div>').css({
+ 'margin': '0 0 1rem 0',
+ 'padding': '3px 0 3px 8px'
+ }).hide();
+
+ var arAnchor = ['land', 'ort', 'plz'];
+
+ for (var i = 0; i < arAnchor.length; i ++) {
+
+ var oField = wpsg_mod_addressvalidation_getField(oFields, arAnchor[i]);
+
+ if (oField.length) {
+
+ // SmartCheckout: Die Felder liegen in einem Grid, die Meldung belegt dort eine eigene Zeile über die volle Breite
+ var oBlock = oField.closest('.sc_field');
+
+ if (oBlock.length) {
+
+ oMessage.css({ 'grid-column': '1 / -1', 'margin': '0' });
+
+ } else {
+
+ oBlock = oField.closest('.wpsg_checkoutblock');
+
+ }
+
+ ((oBlock.length)?oBlock:oField).after(oMessage);
+
+ break;
+
+ }
+
}
- land = jQuery(data.Land + ' option:selected').val();
- land = jQuery(data.Land + ' option:selected').attr('data-land');
- astr1 = localStorage.getItem(data.StorageKey);
- if ((plz.length > 3) && (ort.length > 3) && (strasse.length > 3) &&
- (astr1 != (strasse + plz + ort + land)))
- {
+ return oMessage;
+
+} // function wpsg_mod_addressvalidation_getMessage(oFields)
+
+/**
+ * Setzt den Wert eines Feldes und meldet die Änderung, damit auch Vue (SmartCheckout) den Wert übernimmt
+ *
+ * @param oField
+ * @param strValue
+ */
+function wpsg_mod_addressvalidation_setValue(oField, strValue) {
+
+ if (!oField.length) return;
+
+ var el = oField[0];
+
+ el.value = strValue;
+ el.dispatchEvent(new Event('input', { bubbles: true }));
+ el.dispatchEvent(new Event('change', { bubbles: true }));
+
+} // function wpsg_mod_addressvalidation_setValue(oField, strValue)
+
+/**
+ * Übernimmt den Vorschlag des Dienstes in die Felder einer Adresse
+ *
+ * @param oFields
+ * @param oProposal strasse, nr, plz, ort
+ */
+function wpsg_mod_addressvalidation_apply(oFields, oProposal) {
+
+ var oNr = wpsg_mod_addressvalidation_getField(oFields, 'nr');
+ var strStrasse = oProposal.strasse;
+
+ // Ohne eigenes Feld für die Hausnummer gehört sie zur Straße
+ if (oNr.length) {
+
+ wpsg_mod_addressvalidation_setValue(oNr, oProposal.nr);
+
+ } else if (oProposal.nr !== '') {
+
+ strStrasse = strStrasse + ' ' + oProposal.nr;
- astr1 = strasse + plz + ort + land;
- localStorage.setItem(data.StorageKey, astr1);
- jQuery.ajax({
- url: 'http://api.address-validator.net/api/verify',
- type: 'POST',
- data: { StreetAddress: strasse,
- City: ort,
- PostalCode: plz,
- //State: State,
- CountryCode: land,
- //Locale: land,
- APIKey: data.Key},
- dataType: 'json',
- success: function (json) {
- // check API result
- if (typeof(json.status) != "undefined") {
- status = json.status;
- formattedaddress = json.formattedaddress;
- if (json.status === 'VALID') {
-
-
- } else if ((json.status === 'INVALID') || (json.status === 'SUSPECT')) {
-
- alert(data.MsgTeil1 + '-Validation fehlerhaft. Bitte Straße, Hausnummer, PLZ, Ort und Land überprüfen.');
-
- } else {
-
- alert('Adress-Validation Serverproblem: ' + json.status);
-
- }
- }
-
- }
- });
-
}
-}
+ wpsg_mod_addressvalidation_setValue(wpsg_mod_addressvalidation_getField(oFields, 'strasse'), strStrasse);
+ wpsg_mod_addressvalidation_setValue(wpsg_mod_addressvalidation_getField(oFields, 'plz'), oProposal.plz);
+ wpsg_mod_addressvalidation_setValue(wpsg_mod_addressvalidation_getField(oFields, 'ort'), oProposal.ort);
+
+} // function wpsg_mod_addressvalidation_apply(oFields, oProposal)
+
+/**
+ * Baut die Zeile mit dem Vorschlag des Dienstes, Werte, die von der Eingabe abweichen, sind fett
+ *
+ * @param oFields
+ * @param oData eingegebene Werte (strasse, nr, plz, ort)
+ * @param oProposal vorgeschlagene Werte (strasse, nr, plz, ort)
+ * @return jQuery
+ */
+function wpsg_mod_addressvalidation_renderProposal(oFields, oData, oProposal) {
+
+ var oLine = jQuery('<div class="wpsg_mod_addressvalidation_proposal"></div>').css('margin-top', '4px');
+ var bNr = (wpsg_mod_addressvalidation_getField(oFields, 'nr').length > 0);
+
+ var normalize = function(strValue) {
+
+ return jQuery.trim(String(strValue || '')).replace(/\s+/g, ' ').toLowerCase();
+
+ };
+
+ var addValue = function(strValue, strInput) {
+
+ oLine.append(jQuery((normalize(strValue) !== normalize(strInput))?'<strong></strong>':'<span></span>').text(strValue));
+
+ };
+
+ oLine.append(jQuery('<span></span>').text(wpsg_mod_addressvalidation.labelProposal + ' '));
+
+ // Ohne eigenes Feld für die Hausnummer steht sie in der Eingabe mit in der Straße
+ if (bNr) {
+
+ addValue(oProposal.strasse, oData.strasse);
+
+ if (oProposal.nr !== '') {
+
+ oLine.append(' ');
+ addValue(oProposal.nr, oData.nr);
+
+ }
+
+ } else {
+
+ addValue(jQuery.trim(oProposal.strasse + ' ' + oProposal.nr), oData.strasse);
+
+ }
+
+ oLine.append(', ');
+ addValue(oProposal.plz, oData.plz);
+ oLine.append(' ');
+ addValue(oProposal.ort, oData.ort);
+
+ return oLine;
+
+} // function wpsg_mod_addressvalidation_renderProposal(oFields, oData, oProposal)
+
+/**
+ * Prüft die Adresse über den Shop und zeigt die Meldung an
+ *
+ * @param oFields
+ */
+function wpsg_mod_addressvalidation_check(oFields) {
+
+ var oStrasse = wpsg_mod_addressvalidation_getField(oFields, 'strasse');
+ var oPlz = wpsg_mod_addressvalidation_getField(oFields, 'plz');
+ var oOrt = wpsg_mod_addressvalidation_getField(oFields, 'ort');
+
+ if (!oStrasse.length || !oPlz.length || !oOrt.length) return;
+
+ var oMessage = wpsg_mod_addressvalidation_getMessage(oFields);
+
+ var oData = {
+ action: wpsg_mod_addressvalidation.action,
+ nonce: wpsg_mod_addressvalidation.nonce,
+ type: oFields.type,
+ strasse: jQuery.trim(oStrasse.val() || ''),
+ nr: jQuery.trim(wpsg_mod_addressvalidation_getField(oFields, 'nr').val() || ''),
+ plz: jQuery.trim(oPlz.val() || ''),
+ ort: jQuery.trim(oOrt.val() || ''),
+ land: wpsg_mod_addressvalidation_getField(oFields, 'land').val() || ''
+ };
+
+ // Unvollständige Adressen nicht anfragen
+ if (oData.strasse.length < 3 || oData.plz.length < 3 || oData.ort.length < 2) {
+
+ oMessage.removeData('address').hide().empty();
+
+ return;
+
+ }
+
+ var strAddress = JSON.stringify([oData.strasse, oData.nr, oData.plz, oData.ort, oData.land]);
+
+ if (oMessage.data('address') === strAddress) return;
+
+ oMessage.data('address', strAddress);
+
+ jQuery.post(wpsg_mod_addressvalidation.ajaxurl, oData).done(function(response) {
+
+ // Inzwischen wurde die Adresse erneut geändert
+ if (oMessage.data('address') !== strAddress) return;
+
+ if (!response || !response.success || !response.data.message) {
+
+ oMessage.hide().empty();
+
+ return;
+
+ }
+
+ oMessage.empty().append(jQuery('<span></span>').text(response.data.message));
+
+ if (response.data.proposal) {
+
+ var oProposal = response.data.proposal;
+
+ oMessage.append(wpsg_mod_addressvalidation_renderProposal(oFields, oData, oProposal).append(' ', jQuery('<button type="button" class="button wpsg_mod_addressvalidation_apply"></button>').text(wpsg_mod_addressvalidation.labelApply).on('click', function() {
+
+ wpsg_mod_addressvalidation_apply(oFields, oProposal);
+
+ })));
+
+ }
+
+ oMessage.css('border-left', '4px solid ' + ((response.data.blocked)?'#DD3D36':'#F0AD4E')).show();
+
+ }).fail(function() {
+
+ // Ohne Antwort beim nächsten Ändern erneut versuchen, checkCheckout() prüft beim Absenden trotzdem
+ oMessage.removeData('address').hide().empty();
+
+ });
+
+} // function wpsg_mod_addressvalidation_check(oFields)
+
+/**
+ * Prüft eine bereits ausgefüllte Adresse direkt nach dem Laden, z.B. nach einem abgewiesenen Absenden
+ * Wartet, bis die Felder vorhanden sind (SmartCheckout baut sie erst mit Vue auf)
+ *
+ * @param oFields
+ * @param nTry bisherige Versuche
+ */
+function wpsg_mod_addressvalidation_checkInitial(oFields, nTry) {
+
+ if (!wpsg_mod_addressvalidation_getField(oFields, 'strasse').length) {
+
+ if (nTry < 20) {
+
+ window.setTimeout(function() {
+
+ wpsg_mod_addressvalidation_checkInitial(oFields, nTry + 1);
+
+ }, 250);
+
+ }
+
+ return;
+
+ }
+
+ wpsg_mod_addressvalidation_check(oFields);
+
+} // function wpsg_mod_addressvalidation_checkInitial(oFields, nTry)
+
+/**
+ * Früherer Aufruf aus checkout.phtml, bleibt für angepasste Templates im Theme erhalten
+ * Die Felder werden inzwischen automatisch gebunden, der übergebene API-Key wird nicht mehr verwendet
+ *
+ * @param data
+ */
+function validateAddressBind(data) {
+
+} // function validateAddressBind(data)
+
+jQuery(document).ready(function() {
+
+ if (typeof(wpsg_mod_addressvalidation) == 'undefined') return;
+
+ for (var i = 0; i < wpsg_mod_addressvalidation_fields.length; i ++) {
+
+ wpsg_mod_addressvalidation_bind(wpsg_mod_addressvalidation_fields[i]);
+ wpsg_mod_addressvalidation_checkInitial(wpsg_mod_addressvalidation_fields[i], 0);
+ }
+});
diff --git a/views/mods/mod_addressvalidation/settings_edit.phtml b/views/mods/mod_addressvalidation/settings_edit.phtml
index db047cc..76bf30b 100644
--- a/views/mods/mod_addressvalidation/settings_edit.phtml
+++ b/views/mods/mod_addressvalidation/settings_edit.phtml
@@ -5,8 +5,62 @@
*/
?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_addressvalidation_apikey', __('API-Key', 'wpsg'), $this->get_option('wpsg_mod_addressvalidation_apikey'), array('help' => 'wpsg_mod_addressvalidation_apikey')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_addressvalidation_apikey', __('API-Key', 'wpsg'), $this->get_option('wpsg_mod_addressvalidation_apikey'), ['help' => 'wpsg_mod_addressvalidation_apikey']); ?>
+<?php echo wpsg_drawForm_Select('wpsg_mod_addressvalidation_suspect', __('Verdächtige Adressen', 'wpsg'), $this->view['wpsg_mod_addressvalidation']['arSuspect'], $this->view['wpsg_mod_addressvalidation']['suspect'], ['hint' => __('Der Dienst meldet eine Adresse als verdächtig, wenn sie gefunden wurde, aber einzelne Angaben abweichen, z. B. ein früherer Gemeindename. Mit "Nur Hinweis" geht die Bestellung durch und der Kunde sieht die vorgeschlagene Schreibweise.', 'wpsg')]); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_addressvalidation_ratelimit', __('Anfragen je Besucher (10 Minuten)', 'wpsg'), $this->view['wpsg_mod_addressvalidation']['ratelimit'], ['help' => 'wpsg_mod_addressvalidation_ratelimit']); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_addressvalidation_daylimit', __('Anfragen je Tag (ganzer Shop)', 'wpsg'), $this->view['wpsg_mod_addressvalidation']['daylimit'], ['help' => 'wpsg_mod_addressvalidation_daylimit']); ?>
+
+<?php echo wpsg_drawForm_TextStart(); ?>
+<button type="button" class="button" id="wpsg_mod_addressvalidation_test" data-url="<?php echo esc_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_addressvalidation&do=testApiKey&noheader=1'); ?>" data-nonce="<?php echo esc_attr(wp_create_nonce('wpsg-addressvalidation-testApiKey')); ?>" data-field="#<?php echo esc_attr(wpsg_drawForm_getID('wpsg_mod_addressvalidation_apikey')); ?>">
+ <?php echo esc_html__('API-Key testen', 'wpsg'); ?>
+</button>
+<p id="wpsg_mod_addressvalidation_test_result"></p>
+<p class="description"><?php echo esc_html__('Die Testanfrage verbraucht beim Dienst ein Guthaben.', 'wpsg'); ?></p>
+<?php echo wpsg_drawForm_TextEnd(__('Verbindungstest', 'wpsg'), ['noP' => true]); ?>
<a class="button-primary" id="button-google" target="popup" href="http://www.address-validator.net/address-online-verification-api.html" onclick="window.open('', 'popup', 'width=500;height=200,resizable=yes,menubar=yes')">
- <?php echo __('Schlüssel anfordern', 'wpsg'); ?>
-</a> \ No newline at end of file
+ <?php echo esc_html__('Schlüssel anfordern', 'wpsg'); ?>
+</a>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#wpsg_mod_addressvalidation_test').on('click', function() {
+
+ var oButton = jQuery(this);
+ var oResult = jQuery('#wpsg_mod_addressvalidation_test_result');
+
+ oButton.prop('disabled', true);
+ oResult.removeClass('text-success text-danger').text('<?php echo esc_js(__('Prüfe API-Key …', 'wpsg')); ?>');
+
+ jQuery.post(oButton.data('url'), {
+ apikey: jQuery(oButton.data('field')).val(),
+ wpsg_nonce: oButton.data('nonce')
+ }).done(function(response) {
+
+ oResult.addClass((response.success)?'text-success':'text-danger').text(response.data.message);
+
+ }).fail(function(xhr) {
+
+ var strMessage = '<?php echo esc_js(__('Die Prüfung ist fehlgeschlagen.', 'wpsg')); ?>';
+
+ if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) {
+
+ strMessage = xhr.responseJSON.data.message;
+
+ }
+
+ oResult.addClass('text-danger').text(strMessage);
+
+ }).always(function() {
+
+ oButton.prop('disabled', false);
+
+ });
+
+ });
+
+ });
+
+/* ]]> */</script> \ No newline at end of file
diff --git a/views/warenkorb/checkout.phtml b/views/warenkorb/checkout.phtml
index 1d30a1c..94148bc 100644
--- a/views/warenkorb/checkout.phtml
+++ b/views/warenkorb/checkout.phtml
@@ -4,82 +4,83 @@
* Template für den ersten Schritt der Kasse
* Kundendaten etc.
*/
-
+
//wpsg_debug($this->view);
-?>
+?>
<script type="text/javascript">/* <![CDATA[ */
-
+
jQuery(document).ready(function() {
-
+
<?php if ($this->get_option('wpsg_form_validation') == '1') { ?>
-
- if (typeof jQuery.validationEngine == "object")
- {
-
- jQuery("#form-step2").validationEngine('attach', {promptPosition : "bottomLeft", scroll: false});
-
- jQuery('.wpsg_mod_kundenverwaltung_login').bind('click', function(){
- jQuery("#form-step2").validationEngine('detach');
+
+ if (typeof jQuery.validationEngine == 'object') {
+
+ jQuery('#form-step2').validationEngine('attach', {promptPosition : 'bottomLeft', scroll: false});
+
+ jQuery('.wpsg_mod_kundenverwaltung_login').bind('click', function() {
+
+ jQuery('#form-step2').validationEngine('detach');
+
});
}
-
+
<?php } else if ($this->get_option('wpsg_form_validation') == '2') { ?>
- jQuery.validator.addMethod("cRequired", jQuery.validator.methods.required, "<?php echo __('Dieses Feld ist ein Pflichtfeld.', 'wpsg'); ?>");
+ jQuery.validator.addMethod('cRequired', jQuery.validator.methods.required, '<?php echo esc_js(__('Dieses Feld ist ein Pflichtfeld.', 'wpsg')); ?>');
jQuery.validator.addClassRules('validate[required]', { cRequired: true } );
- jQuery("#form-step2").validate( {
+ jQuery('#form-step2').validate( {
ignore: '',
errorClass: 'wpsg_error',
onsubmit: false,
showErrors: function(errorMap, errorList) {
- this.defaultShowErrors();
+ this.defaultShowErrors();
}
- } );
+ } );
- jQuery('#wpsg_checkout2button').bind('click', function() {
+ jQuery('#wpsg_checkout2button').bind('click', function() {
var bReturn = jQuery('#form-step2').validate().form();
if (jQuery('#form-step2 input.wpsg_error').length > 0) jQuery('#form-step2 input.wpsg_error')[0].focus();
return bReturn;
-
+
} );
-
+
<?php } ?>
jQuery('.wpsg_checkout input').bind('keyup keypress', function(e) {
var jqThis = jQuery(this);
-
+
// Enter lass ich direkt durch
- if (jqThis.attr("type") === 'submit') return true;
-
+ if (jqThis.attr('type') === 'submit') return true;
+
var keyCode = e.keyCode || e.which;
-
+
if (keyCode == 13) {
-
+
if (jqThis.parents('.wpsg_loginform').length > 0) {
jQuery('input[name="wpsg_mod_kundenverwaltung_login"]').click();
-
+
} else {
-
+
jQuery('#wpsg_checkout2button').click();
-
+
}
-
- }
-
+
+ }
+
} );
-
+
} );
<?php /* Copy&Paste für das Eingabefeld "E-Mail-Wiederholung sperren */ ?>
window.onload = function() {
-
+
var email2 = document.getElementById('email2');
email2.onpaste = function(e) {
@@ -87,353 +88,345 @@
e.preventDefault();
}
+
}
-
+
/* ]]> */</script>
<div class="wpsg alignwide wpsg_checkout">
- <?php echo $this->writeFrontendMessage(); ?>
-
+ <?php echo $this->writeFrontendMessage(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML aus writeFrontendMessage(), die Meldungen setzt der Shop selbst ?>
+
<?php $GLOBALS['step'] = 2; $this->render(WPSG_PATH_VIEW.'/warenkorb/progress.phtml'); ?>
-
- <form id="form-step2" method="post" action="<?php echo $this->getURL(wpsg_ShopController::URL_BASKET); ?>" enctype="multipart/form-data">
- <?php /* Einbindung des Logins im Checkout */ ?>
+ <form id="form-step2" method="post" action="<?php echo esc_url($this->getURL(wpsg_ShopController::URL_BASKET)); ?>" enctype="multipart/form-data">
+
+ <?php /* Einbindung des Logins im Checkout */ ?>
<div class="wpsg_loginform">
<?php $this->callMod('wpsg_mod_kundenverwaltung', 'checkout_login'); ?>
</div>
-
+
<div class="wpsg_box" id="wpsg_box_kundendaten">
-
+
<?php /*Wenn Kunden eingeloggt, oder wenn Kunde nicht eingeloggt */ ?>
<?php if ($this->callMod('wpsg_mod_kundenverwaltung', 'isLoggedIn')) { ?>
- <h2><?php echo __('Bitte überprüfen Sie Ihre Kundendaten','wpsg');?></h2>
- <?php } else { ?>
- <h2><?php echo __('Bitte geben Sie Ihre Kundendaten ein', 'wpsg'); ?></h2>
+ <h2><?php echo esc_html__('Bitte überprüfen Sie Ihre Kundendaten', 'wpsg'); ?></h2>
+ <?php } else { ?>
+ <h2><?php echo esc_html__('Bitte geben Sie Ihre Kundendaten ein', 'wpsg'); ?></h2>
<?php } ?>
-
+
<div class="wpsg_spacer"></div>
-
+
<div class="wpsg_inner">
-
+
<?php if ($this->view['pflicht']['firma'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_firma_block">
- <label for="wpsg_firma"><?php echo __("Firma:", "wpsg"); ?>
+ <label for="wpsg_firma"><?php echo esc_html__('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("firma", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_firma" name="wpsg[checkout][firma]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['firma'])); ?>" />
+ <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 wpsg_hspc($this->view['basket']['checkout']['firma']??''); ?>" />
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['anrede'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_anrede">
- <label for="wpsg_title"><?php echo __('Anrede:', 'wpsg'); ?>
+ <label for="wpsg_title"><?php echo esc_html__('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]':''); ?> wpsg_checkout <?php echo ((in_array("title", (array)$this->view['error']))?'wpsg_error':''); ?>" id="wpsg_title" name="wpsg[checkout][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 ((strval($this->view['basket']['checkout']['title'] ?? '-1') === strval($i))?'selected="selected"':''); ?>><?php echo $t; $i++; ?></option>
- <?php } ?>
+ <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]">
+ <option value="-1"><?php echo esc_html__('Bitte auswählen', 'wpsg'); ?></option>
+ <?php $i = 0; foreach (explode('|', $this->view['pflicht']['anrede_auswahl']) as $t) { ?>
+ <option value="<?php echo esc_attr($i); ?>" <?php echo ((strval(($this->view['basket']['checkout']['title']??'-1')) === strval($i))?'selected="selected"':''); ?>><?php echo wpsg_hspc($t); $i++; ?></option>
+ <?php } ?>
</select>
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['vname'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_vorname">
- <label for="vname" class="wpsg_checkout"><?php echo __("Vorname:", "wpsg"); ?>
+ <label for="vname" class="wpsg_checkout"><?php echo esc_html__('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]':''); ?> wpsg_checkout <?php echo ((in_array("vname", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ 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"
autocomplete="vname"
name="wpsg[checkout][vname]"
- value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['vname'])); ?>"
+ value="<?php echo wpsg_hspc($this->view['basket']['checkout']['vname']??''); ?>"
/>
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['name'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_name">
- <label for="name" class="wpsg_checkout"><?php echo __("Name:", "wpsg"); ?>
+ <label for="name" class="wpsg_checkout"><?php echo esc_html__('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]':''); ?> wpsg_checkout <?php echo ((in_array("name", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ 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"
autocomplete="name"
name="wpsg[checkout][name]"
- value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['name'])); ?>"
+ value="<?php echo wpsg_hspc($this->view['basket']['checkout']['name']??''); ?>"
/>
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['email'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_email">
- <label for="email" class="wpsg_checkout"><?php echo __("E-Mail Adresse:", "wpsg"); ?>
+ <label for="email" class="wpsg_checkout"><?php echo esc_html__('E-Mail Adresse:', 'wpsg'); ?>
<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
</label>
- <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(wpsg_getStr($this->view['basket']['checkout']['email'])); ?>"
- autocomplete="off"
- />
+ <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 wpsg_hspc($this->view['basket']['checkout']['email']??''); ?>"
+ autocomplete="off"
+ />
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['email'] != '2') { ?>
<?php if (isset($this->view['pflicht']['emailconfirm']) && $this->view['pflicht']['emailconfirm'] == '1') { ?>
<div class="wpsg_checkoutblock" id="wpsg_email2">
- <label for="email" class="wpsg_checkout"><?php echo __("E-Mail (Wiederholung):", "wpsg"); ?>
+ <label for="email" class="wpsg_checkout"><?php echo esc_html__('E-Mail (Wiederholung):', 'wpsg'); ?>
<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
</label>
- <input
- class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email2", (array)$this->view['error']))?'wpsg_error':''); ?>"
- type="email"
- id="email2"
- name="wpsg[checkout][email2]"
- value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['email2'])); ?>"
- autocomplete="off"
- />
+ <input
+ class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array('email2', (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="email"
+ id="email2"
+ name="wpsg[checkout][email2]"
+ value="<?php echo wpsg_hspc($this->view['basket']['checkout']['email2']??''); ?>"
+ autocomplete="off"
+ />
</div>
<?php } ?>
<?php } ?>
-
+
<?php if (intval($this->view['pflicht']['eInvoice']??0) === 1) { ?>
<div class="wpsg_checkoutblock" id="wpsg_email_einvoice">
- <label for="wpsg_email_einvoice_input" class="wpsg_checkout"><?php echo __("E-Mail (für eRechnung, optional)", "wpsg"); ?></label>
+ <label for="wpsg_email_einvoice_input" class="wpsg_checkout"><?php echo esc_html__('E-Mail (für eRechnung, optional)', 'wpsg'); ?></label>
<input
- class="wpsg_input_text wpsg_checkout <?php echo ((in_array("email_einvoice", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ class="wpsg_input_text wpsg_checkout <?php echo ((in_array('email_einvoice', (array)$this->view['error']))?'wpsg_error':''); ?>"
type="email"
id="wpsg_email_einvoice_input"
name="wpsg[checkout][email_einvoice]"
- value="<?php echo htmlspecialchars($this->view['basket']['checkout']['email_einvoice']??''); ?>"
+ value="<?php echo wpsg_hspc($this->view['basket']['checkout']['email_einvoice']??''); ?>"
autocomplete="off"
/>
</div>
<?php } ?>
<?php if (intval($this->view['pflicht']['leitweg']??0) === 1) { ?>
- <div class="wpsg_checkoutblock" id="wpsg_leitweg_id">
- <label for="wpsg_leitweg_id_input" class="wpsg_checkout"><?php echo __("Leitweg-ID (für eRechnung, optional)", "wpsg"); ?></label>
- <input
- class="wpsg_input_text wpsg_checkout <?php echo ((in_array("leitweg_id", (array)$this->view['error']))?'wpsg_error':''); ?>"
- type="text"
- id="wpsg_email_leitweg_id_input"
- name="wpsg[checkout][leitweg_id]"
- value="<?php echo htmlspecialchars($this->view['basket']['checkout']['leitweg_id']??''); ?>"
- autocomplete="off"
- />
- </div>
+ <div class="wpsg_checkoutblock" id="wpsg_leitweg_id">
+ <label for="wpsg_leitweg_id_input" class="wpsg_checkout"><?php echo esc_html__('Leitweg-ID (für eRechnung, optional)', 'wpsg'); ?></label>
+ <input
+ class="wpsg_input_text wpsg_checkout <?php echo ((in_array('leitweg_id', (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="text"
+ id="wpsg_email_leitweg_id_input"
+ name="wpsg[checkout][leitweg_id]"
+ value="<?php echo wpsg_hspc($this->view['basket']['checkout']['leitweg_id']??''); ?>"
+ autocomplete="off"
+ />
+ </div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['geb'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_geburtsdatum">
- <label for="geb" class="wpsg_checkout"><?php echo __('Geburtsdatum (Format: TT.MM.JJJJ):',"wpsg"); ?>
+ <label for="geb" class="wpsg_checkout"><?php echo esc_html__('Geburtsdatum (Format: TT.MM.JJJJ):', 'wpsg'); ?>
<?php if ($this->view['pflicht']['geb'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
</label>
- <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(wpsg_getStr($this->view['basket']['checkout']['geb'])); ?>" />
+ <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 wpsg_hspc($this->view['basket']['checkout']['geb']??''); ?>" />
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['fax'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_fax">
- <label for="fax" class="wpsg_checkout"><?php echo __("Fax.:", "wpsg"); ?>
+ <label for="fax" class="wpsg_checkout"><?php echo esc_html__('Fax.:', 'wpsg'); ?>
<?php if ($this->view['pflicht']['fax'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
</label>
- <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="text" id="fax" name="wpsg[checkout][fax]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['fax'])); ?>" />
+ <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="text" id="fax" name="wpsg[checkout][fax]" value="<?php echo wpsg_hspc($this->view['basket']['checkout']['fax']??''); ?>" />
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['tel'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_telefon">
- <label for="tel" class="wpsg_checkout"><?php echo __("Tel.:", "wpsg"); ?>
+ <label for="tel" class="wpsg_checkout"><?php echo esc_html__('Tel.:', 'wpsg'); ?>
<?php if ($this->view['pflicht']['tel'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
</label>
- <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="text" id="tel" name="wpsg[checkout][tel]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['tel'])); ?>" />
+ <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="text" id="tel" name="wpsg[checkout][tel]" value="<?php echo wpsg_hspc($this->view['basket']['checkout']['tel']??''); ?>" />
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['strasse'] != '2') { ?>
-
- <?php if (wpsg_isSizedInt($this->view['pflicht']['wpsg_showNr'])) { ?>
-
+
+ <?php if (is_numeric($this->view['pflicht']['wpsg_showNr']??null) && $this->view['pflicht']['wpsg_showNr'] > 0) { ?>
+
<div class="wpsg_checkoutblock" id="wpsg_streetnr">
- <label for="strasse" class="street wpsg_checkout"><?php echo __('Straße:', 'wpsg'); ?>
+ <label for="strasse" class="street wpsg_checkout"><?php echo esc_html__('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]':''); ?> 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(wpsg_getStr($this->view['basket']['checkout']['strasse'])); ?>" />
+ <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 wpsg_hspc($this->view['basket']['checkout']['strasse']??''); ?>" />
</label>
- <label for="nr" class="nr wpsg_checkout"><?php echo __('Nr:', 'wpsg'); ?>
+ <label for="nr" class="nr wpsg_checkout"><?php echo esc_html__('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]':''); ?> wpsg_checkout <?php echo ((in_array("nr", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="nr" name="wpsg[checkout][nr]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['nr'])); ?>" />
+ <input class="<?php echo (($this->view['pflicht']['strasse'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array('nr', (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="nr" name="wpsg[checkout][nr]" value="<?php echo wpsg_hspc($this->view['basket']['checkout']['nr']??''); ?>" />
</label>
</div>
-
+
<?php } else { ?>
<div class="wpsg_checkoutblock" id="wpsg_strasse">
- <label for="strasse" class="wpsg_checkout"><?php echo __("Straße, Nr.:", "wpsg"); ?>
+ <label for="strasse" class="wpsg_checkout"><?php echo esc_html__('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]':''); ?> 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(wpsg_getStr($this->view['basket']['checkout']['strasse'])); ?>" />
+ <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 wpsg_hspc($this->view['basket']['checkout']['strasse']??''); ?>" />
</div>
-
+
<?php } ?>
-
+
<?php } ?>
-
+
<?php if ($this->view['pflicht']['plz'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_postleitzahl">
- <label for="plz" class="wpsg_checkout"><?php echo __("Postleitzahl:", "wpsg"); ?>
+ <label for="plz" class="wpsg_checkout"><?php echo esc_html__('Postleitzahl:', 'wpsg'); ?>
<?php if ($this->view['pflicht']['plz'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
</label>
- <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(wpsg_getStr($this->view['basket']['checkout']['plz'])); ?>" />
+ <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 wpsg_hspc($this->view['basket']['checkout']['plz']??''); ?>" />
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['ort'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_ort">
- <label for="ort" class="wpsg_checkout"><?php echo __("Ort:", "wpsg"); ?>
+ <label for="ort" class="wpsg_checkout"><?php echo esc_html__('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]':''); ?> 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(wpsg_getStr($this->view['basket']['checkout']['ort'])); ?>" />
+ <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 wpsg_hspc($this->view['basket']['checkout']['ort']??''); ?>" />
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['land'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_land_block">
- <label for="wpsg_land" class="wpsg_checkout"><?php echo __("Land:", "wpsg"); ?>
+ <label for="wpsg_land" class="wpsg_checkout"><?php echo esc_html__('Land:', 'wpsg'); ?>
<?php if ($this->view['pflicht']['land'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
- </label>
- <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">
- <option value="-1"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
+ </label>
+ <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">
+ <option value="-1"><?php echo esc_html__('Bitte auswählen', 'wpsg'); ?></option>
<?php foreach ($this->view['laender'] as $l) { ?>
- <option value="<?php echo wpsg_hspc($l['id']); ?>" <?php echo (($l['id'] == $this->view['basket']['checkout']['land'])?'selected="selected"':((!wpsg_isSizedInt($this->view['basket']['checkout']['land']) && $this->get_option('wpsg_defaultland') == $l['id'])?'selected="selected"':'')); ?>><?php echo wpsg_hspc(__($l['name'], 'wpsg')); ?></option>
+ <option value="<?php echo wpsg_hspc($l['id']); ?>" <?php echo (($l['id'] == $this->view['basket']['checkout']['land'])?'selected="selected"':((!(is_numeric($this->view['basket']['checkout']['land']??null) && $this->view['basket']['checkout']['land'] > 0) && $this->get_option('wpsg_defaultland') == $l['id'])?'selected="selected"':'')); ?>><?php echo wpsg_hspc(__($l['name'], 'wpsg')); ?></option>
<?php } ?>
</select>
</div>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['ustidnr'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_ustidnr_block">
- <label for="wpsg_ustidnr" class="wpshopgermany_checkout"><?php echo __("UStIdNr.:", "wpsg"); ?>
+ <label for="wpsg_ustidnr" class="wpshopgermany_checkout"><?php echo esc_html__('UStIdNr.:', 'wpsg'); ?>
<?php if ($this->view['pflicht']['ustidnr'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
</label>
- <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'])); ?>" />
+ <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 wpsg_hspc($this->view['basket']['checkout']['ustidnr']??''); ?>" />
</div>
<?php } ?>
-
+
<?php /* Automatische Einbindung der benutzerdefinierten Felder */ ?>
<?php if ($this->get_option('wpsg_kundenvariablen_show') == '1') { ?>
<?php foreach ((array)$this->view['pflicht']['custom'] as $c_id => $c) { if ($c['show'] != '2') { ?>
<div class="wpsg_checkoutblock">
- <label class="wpsg_cv wpsg_checkout" for="wpsg_cv_<?php echo $c_id; ?>">
+ <label class="wpsg_cv wpsg_checkout" for="wpsg_cv_<?php echo esc_attr($c_id); ?>">
<?php echo wpsg_hspc(__($c['name'], 'wpsg')); ?><?php if ($c['show'] == '0') { ?> <span class="wpsg_required">*</span><?php } ?>:
- </label>
- <?php if ($c['typ'] == '0') { // Textfeld ?>
- <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]); ?>" />
- <?php } else if ($c['typ'] == '1') { $arAuswahl = explode("|", $c['auswahl']); // Auswahlfeld ?>
- <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; ?>]">
- <option value="-1"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
- <?php foreach ((array)$arAuswahl as $a) { ?>
- <option value="<?php echo wpsg_hspc($a); ?>" <?php echo (($a == @$this->view['basket']['checkout']['custom'][$c_id])?'selected="selected"':''); ?>><?php echo wpsg_hspc($a); ?></option>
- <?php } ?>
- </select>
- <?php } else if ($c['typ'] == '2') { // Checkbox ?>
- <input type="hidden" name="wpsg[checkout][custom][<?php echo $c_id; ?>]" value="0" />
- <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"':''); ?> />
- <?php } ?>
+ </label>
+ <?php /* Textfeld */ ?>
+ <?php if ($c['typ'] == '0') { ?>
+ <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 esc_attr($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]); ?>" />
+ <?php } else if ($c['typ'] == '1') { ?>
+ <?php /* Auswahlfeld */ $arAuswahl = explode('|', $c['auswahl']); ?>
+ <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 esc_attr($c_id); ?>]">
+ <option value="-1"><?php echo esc_html__('Bitte auswählen', 'wpsg'); ?></option>
+ <?php foreach ((array)$arAuswahl as $a) { ?>
+ <option value="<?php echo wpsg_hspc($a); ?>" <?php echo (($a == ($this->view['basket']['checkout']['custom'][$c_id]??null))?'selected="selected"':''); ?>><?php echo wpsg_hspc($a); ?></option>
+ <?php } ?>
+ </select>
+ <?php } else if ($c['typ'] == '2') { ?>
+ <?php /* Checkbox */ ?>
+ <input type="hidden" name="wpsg[checkout][custom][<?php echo esc_attr($c_id); ?>]" value="0" />
+ <input class="<?php echo (($c['show'] == '0')?'validate[required]':''); ?> checkbox" type="checkbox" value="1" name="wpsg[checkout][custom][<?php echo esc_attr($c_id); ?>]" value="1" <?php if (isset($this->view['basket']['checkout']['custom'][$c_id]) && $this->view['basket']['checkout']['custom'][$c_id] == '1') echo 'checked="checked"'; ?> />
+ <?php } ?>
</div>
<?php } } ?>
<?php } ?>
<?php /* Automatische Einbindung der benutzerdefinierten Kundenfelder ENDE */ ?>
<div class="wpsg_clear"></div>
-
+
<?php /* $this->callMods('checkout_customer_inner'); START */ ?>
-
- <?php /* Passwortabfrage für Neuregistrierung */ ?>
- <?php echo $this->callMod('wpsg_mod_kundenverwaltung', 'checkout_customer_inner'); ?>
-
+
+ <?php /* Passwortabfrage für Neuregistrierung */ ?>
+ <?php echo $this->callMod('wpsg_mod_kundenverwaltung', 'checkout_customer_inner'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML des Moduls ?>
+
<?php /*echo $this->callMod('wpsg_mod_kundenverwaltung', 'checkout_customer_inner'); */ ?>
-
+
<?php /* Abfrage Satollo-Newsletter */ ?>
- <?php echo $this->callMod('wpsg_mod_nlsatolo', 'checkout_customer_inner'); ?>
-
+ <?php echo $this->callMod('wpsg_mod_nlsatolo', 'checkout_customer_inner'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML des Moduls ?>
+
<?php /* Einverständnisabfrage Trusted Shops */ ?>
- <?php echo $this->callMod('wpsg_mod_trustedshops', 'checkout_customer_inner'); ?>
-
+ <?php echo $this->callMod('wpsg_mod_trustedshops', 'checkout_customer_inner'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML des Moduls ?>
+
<?php /* Newsletter Integration */ ?>
- <?php echo $this->callMod('wpsg_mod_newsletter', 'checkout_customer_inner'); ?>
-
+ <?php echo $this->callMod('wpsg_mod_newsletter', 'checkout_customer_inner'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML des Moduls ?>
+
<?php /* $this->callMods('checkout_customer_inner'); ENDE */ ?>
-
+
</div>
-
+
</div>
-
- <?php $this->callMods('checkout_inner_prebutton', array(&$this->view)); ?>
-
+
+ <?php $this->callMods('checkout_inner_prebutton', [&$this->view]); ?>
+
<div class="wpsg_clear"></div>
-
+
<div class="wpsg_box">
-
- <h2><?php echo __('Bestellkommentar', 'wpsg'); ?></h2>
-
+
+ <h2><?php echo esc_html__('Bestellkommentar', 'wpsg'); ?></h2>
+
<div class="wpsg_spacer"></div>
-
+
<div class="wpsg_inner wpsg_commentblock">
- <textarea name="wpsg[checkout][comment]" id="wpsg_checkout_comment"><?php echo wpsg_getStr($this->view['basket']['checkout']['comment']); ?></textarea>
+ <textarea name="wpsg[checkout][comment]" id="wpsg_checkout_comment"><?php echo esc_textarea($this->view['basket']['checkout']['comment']??''); ?></textarea>
</div>
</div>
-
+
<div class="wpsg_mandatoryfield_hint">
- <?php echo wpsg_translate(__('Mit #1# gekennzeichnete Felder sind Pflichtfelder.', 'wpsg'), '<span class="wpsg_required">*</span>'); ?>
+ <?php echo wp_kses_post(wpsg_translate(esc_html__('Mit #1# gekennzeichnete Felder sind Pflichtfelder.', 'wpsg'), '<span class="wpsg_required">*</span>')); ?>
</div>
-
+
<br />
-
+
<?php $this->ClearSessionErrors(); ?>
-
- <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" />
- <input type="submit" id="wpsg_checkout2button" class="wpsg_button wpsg_checkout2button" value="<?php echo __('weiter', 'wpsg'); ?>" name="wpsg_checkout" />
-
+
+ <input type="submit" onclick="location.href='<?php echo esc_js($this->getURL(wpsg_ShopController::URL_BASKET)); ?>'; return false;" class="wpsg_button wpsg_basketbutton" value="<?php echo esc_attr__('zurück zum Warenkorb', 'wpsg'); ?>" name="wpsg_redirect_basket" />
+ <input type="submit" id="wpsg_checkout2button" class="wpsg_button wpsg_checkout2button" value="<?php echo esc_attr__('weiter', 'wpsg'); ?>" name="wpsg_checkout" />
+
<div class="wpsg_clear"></div>
-
- <br />
-
+
+ <br />
+
</form>
-
+
<script type="text/javascript">/* <![CDATA[ */
jQuery(document).ready(function() {
- jQuery('#wpsg_checkout_set_comment').bind('change', function() {
- if (jQuery(this).attr('checked') == true || jQuery(this).attr('checked') == "checked") jQuery('#wpsg_checkout_comment').show();
+
+ jQuery('#wpsg_checkout_set_comment').bind('change', function() {
+
+ if (jQuery(this).attr('checked') == true || jQuery(this).attr('checked') == 'checked') jQuery('#wpsg_checkout_comment').show();
else jQuery('#wpsg_checkout_comment').hide();
- } );
- } );
-
- <?php if ($this->hasMod('wpsg_mod_addressvalidation')) { ?>
- validateAddressBind( {
- Strasse: '#strasse',
- Nr: '#nr',
- Ort: '#ort',
- PLZ: '#plz',
- Land: '#wpsg_land',
- Key: '<?php echo $this->get_option('wpsg_mod_addressvalidation_apikey');?>',
- StorageKey: 'KundenAddress',
- MsgTeil1: 'Kundenadresse'
} );
- <?php } ?>
-
- //} );
+
+ } );
/* ]]> */</script>
-
+
</div> \ No newline at end of file