diff options
| author | hartmut <noreply@maennchen1.de> | 2016-11-18 06:58:34 +0000 |
|---|---|---|
| committer | hartmut <noreply@maennchen1.de> | 2016-11-18 06:58:34 +0000 |
| commit | 753c1978e84e829538f5c0b4f2f45267fcaf8341 (patch) | |
| tree | 62641e13d96070a8aff0937dc53f2ae9317348a9 | |
| parent | 24a29c6eceac73735d2c5724b28e0146f01e43d7 (diff) | |
Shop V4 Anpassungen Backend (Gutschein, Rabatt, Zahlungsart)
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5922 0d5edaf7-2b12-4e95-93f4-047927463d4b
| -rw-r--r-- | views/admin/form/link.phtml | 42 | ||||
| -rw-r--r-- | views/admin/kundendaten_tab2.phtml | 4 | ||||
| -rw-r--r-- | views/mods/mod_creditcard/order_view_afterpayment.phtml | 14 | ||||
| -rw-r--r-- | views/mods/mod_crefopay/settings_edit.phtml | 12 | ||||
| -rw-r--r-- | views/mods/mod_paypalapi/settings_edit.phtml | 41 | ||||
| -rw-r--r-- | views/mods/mod_targo/order_done.phtml | 69 | ||||
| -rw-r--r-- | views/mods/mod_targo/settings_edit.phtml | 5 | ||||
| -rw-r--r-- | views/order/index.phtml | 3 | ||||
| -rw-r--r-- | views/order/view.phtml | 62 | ||||
| -rw-r--r-- | views/order/view_orderdata.phtml | 351 | ||||
| -rw-r--r-- | views/produkttemplates/standard.phtml | 2 | ||||
| -rw-r--r-- | views/warenkorb/checkout.phtml | 16 |
12 files changed, 557 insertions, 64 deletions
diff --git a/views/admin/form/link.phtml b/views/admin/form/link.phtml new file mode 100644 index 0000000..9386d2f --- /dev/null +++ b/views/admin/form/link.phtml @@ -0,0 +1,42 @@ +<div class="form-group form-group-sm <?php echo ((wpsg_isSizedString($this->view['field_config']['help']))?'has-feedback':''); ?>">
+
+ <label class="col-sm-6 control-label" for="<?php echo $this->view['field_id']; ?>"><?php echo $this->view['field_label']; ?></label>
+
+ <div class="col-sm-6">
+
+ <div class="wpsg_field_wrap" style="padding-top:3px;">
+ <a href="#"
+ class="<?php echo wpsg_getStr($this->view['field_config']['class']) ?>"
+ name="<?php echo $this->view['field_name']; ?>"
+ autofocus="true"
+ tabindex="<?php
+
+ if (!isset($GLOBALS['wpsg']['tabindex']))
+ {
+
+ $GLOBALS['wpsg']['tabindex'] = 10;
+
+ }
+ else
+ {
+
+ $GLOBALS['wpsg']['tabindex'] += 10;
+
+ }
+
+ echo $GLOBALS['wpsg']['tabindex'];
+
+ ?>"
+ id="<?php echo $this->view['field_id']; ?>"
+ ><?php echo $this->view['field_link']; ?></a>
+
+ <?php if (wpsg_isSizedString($this->view['field_config']['help'])) { ?>
+ <a href="#" a-wpsg-tip="<?php echo $this->view['field_config']['help']; ?>" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=<?php echo $this->view['field_config']['help']; ?>" class="glyphicon glyphicon glyphicon-info-sign form-control-feedback" aria-hidden="true"></a>
+ <?php } ?>
+ </div>
+
+ </div>
+
+ <div class="clearfix wpsg_clear"></div>
+
+</div>
\ No newline at end of file diff --git a/views/admin/kundendaten_tab2.phtml b/views/admin/kundendaten_tab2.phtml index 836256a..a01c7df 100644 --- a/views/admin/kundendaten_tab2.phtml +++ b/views/admin/kundendaten_tab2.phtml @@ -24,8 +24,8 @@ <?php foreach ($this->view['pflicht']['custom'] as $c_id => $c) { ?>
<tr class="wpsg_customervar_row_<?php echo $c_id; ?>">
<td class="col0"><?php echo $c_id; ?></td>
- <td class="col2"><span class="wpsg_editable" id="kundenvariable_name_<?php echo $c_id; ?>"><?php echo wpsg_hspc($c['name']); ?></span></td>
- <td class="col3">
+ <td class="col1"><span class="wpsg_editable" id="kundenvariable_name_<?php echo $c_id; ?>"><?php echo wpsg_hspc($c['name']); ?></span></td>
+ <td class="col2">
<select class="form-control" name="pflicht[custom][<?php echo $c_id; ?>][show]">
<option <?php echo (($c['show'] == '0')?'selected="selected"':''); ?> value="0"><?php echo __('Ja', 'wpsg'); ?></option>
<option <?php echo (($c['show'] == '1')?'selected="selected"':''); ?> value="1"><?php echo __('Nein', 'wpsg'); ?></option>
diff --git a/views/mods/mod_creditcard/order_view_afterpayment.phtml b/views/mods/mod_creditcard/order_view_afterpayment.phtml new file mode 100644 index 0000000..5670764 --- /dev/null +++ b/views/mods/mod_creditcard/order_view_afterpayment.phtml @@ -0,0 +1,14 @@ +<?php
+
+ /**
+ * Das Template wird in der Bestellansicht eingebunden und zeigt die Kreditkartendaten des Kunden an, die er während der Bestellung angegeben hat
+ */
+
+?>
+<br />
+<?php echo wpsg_drawForm_Input('', __('Typ der Kreditkarte', 'wpsg'), $this->view['wpsg_mod_creditcard']['typ'], array('text' => true, 'clear_after' => true, 'readonly' => true)); ?>
+<?php echo wpsg_drawForm_Input('', __('Inhaber der Kreditkarte', 'wpsg'), $this->view['wpsg_mod_creditcard']['inhaber'], array('text' => true, 'clear_after' => true, 'readonly' => true)); ?>
+<?php echo wpsg_drawForm_Input('', __('Kreditkarten-Nummer', 'wpsg'), $this->view['wpsg_mod_creditcard']['knr'], array('text' => true, 'clear_after' => true, 'readonly' => true)); ?>
+<?php echo wpsg_drawForm_Input('', __('Prüfziffer', 'wpsg'), $this->view['wpsg_mod_creditcard']['pruefz'], array('text' => true, 'clear_after' => true, 'readonly' => true)); ?>
+<?php echo wpsg_drawForm_Input('', __('Gültig bis', 'wpsg'), $this->view['wpsg_mod_creditcard']['gueltigm'].'/'.$this->view['wpsg_mod_creditcard']['gueltigj'], array('text' => true, 'clear_after' => true, 'readonly' => true)); ?>
+
diff --git a/views/mods/mod_crefopay/settings_edit.phtml b/views/mods/mod_crefopay/settings_edit.phtml index 39bc4a2..3d0f8ba 100644 --- a/views/mods/mod_crefopay/settings_edit.phtml +++ b/views/mods/mod_crefopay/settings_edit.phtml @@ -23,15 +23,9 @@ <?php echo wpsg_drawForm_Input('wpsg_mod_crefopay_frameheight', __('Höhe des IFrames in px', 'wpsg'), $this->get_option('wpsg_mod_crefopay_frameheight'), array('help' => 'wpsg_mod_crefopay_frameheight')); ?>
-<div class="wpsg_form_field ">
- <div class="wpsg_form_left">
- <label for=""><?php echo __('MNS Statuswechsel', 'wpsg'); ?>:</label>
- </div>
- <div class="wpsg_form_right">
- <a href="#" class="wpsg_mod_crefopay_switchstatemapping" onclick="return wpsg_mod_crefopay_mnsstatemapping();"><?php echo __('Bearbeiten', 'wpsg'); ?></a>
- </div>
- <div class="wpsg_clear"></div>
-</div>
+<?php echo wpsg_drawForm_Link('wpsg_mod_crefopay_link', __('MNS Statuswechsel', 'wpsg'),
+ __('Bearbeiten', 'wpsg'), array('class' => 'wpsg_mod_crefopay_switchstatemapping')); ?>
+
<div class="wpsg_mod_crefopay_mnsstatemapping">
<?php foreach ($this->view['transactionMapping'] as $crefopay_status => $wpsg_status) { ?>
<?php echo wpsg_drawForm_Select('wpsg_mod_crefopay_statemapping_'.$crefopay_status, __($wpsg_status[1], 'wpsg'), wpsg_array_merge(array('-1' => __('Kein Wechsel', 'wpsg')), $this->arStatus), $this->get_option('wpsg_mod_crefopay_statemapping_'.$crefopay_status)); ?>
diff --git a/views/mods/mod_paypalapi/settings_edit.phtml b/views/mods/mod_paypalapi/settings_edit.phtml index 24a0cf0..9eface5 100644 --- a/views/mods/mod_paypalapi/settings_edit.phtml +++ b/views/mods/mod_paypalapi/settings_edit.phtml @@ -40,19 +40,14 @@ <br />
-<div class="wpsg_form_field ">
- <div class="wpsg_form_left">
- <label for=""><?php echo __('Stornierung bei Statuswechsel', 'wpsg'); ?>:</label>
- </div>
- <div class="wpsg_form_right">
- <a href="#" class="wpsg_mod_paypalapi_stornostate"><?php echo __('Bearbeiten', 'wpsg'); ?></a>
- </div>
- <div class="wpsg_clear"></div>
-</div>
+<?php echo wpsg_drawForm_Link('wpsg_mod_paypalapi_link', __('Stornierung bei Statuswechsel', 'wpsg'),
+ __('Bearbeiten', 'wpsg'), array('help' => 'wpsg_mod_paypalapi_link', 'class' => 'wpsg_mod_paypalapi_stornostate')); ?>
+
+
<div class="wpsg_mod_paypalapi_stornostate_layer" style="display:none;">
<?php foreach ($this->arStatus as $status_id => $status_label) { $arStornoStatus = (array)$this->get_option('wpsg_mod_paypalapi_stornostate'); ?>
- <?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_stornostate['.$status_id.']', __($status_label, 'wpsg'), $arStornoStatus[$status_id], array('labelright' => true)); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_stornostate['.$status_id.']', __($status_label, 'wpsg'), wpsg_getInt($arStornoStatus[$status_id]), array('labelright' => true)); ?>
<?php } ?>
<br />
@@ -130,19 +125,19 @@ jQuery('#wpsg_mod_paypalapi_plus_aktiv').bind('change', function() {
if (jQuery(this).is(':checked'))
-- {
--
-- jQuery('.wpsg_mod_paypalapi_plus_aktiv').show();
-- jQuery('.wpsg_mod_paypalapi_plus_inaktiv').hide();
--
-- }
-- else
-- {
--
-- jQuery('.wpsg_mod_paypalapi_plus_aktiv').hide();
-- jQuery('.wpsg_mod_paypalapi_plus_inaktiv').show();
--
-- }
+ {
+
+ jQuery('.wpsg_mod_paypalapi_plus_aktiv').show();
+ jQuery('.wpsg_mod_paypalapi_plus_inaktiv').hide();
+
+ }
+ else
+ {
+
+ jQuery('.wpsg_mod_paypalapi_plus_aktiv').hide();
+ jQuery('.wpsg_mod_paypalapi_plus_inaktiv').show();
+
+ }
} ).change();
diff --git a/views/mods/mod_targo/order_done.phtml b/views/mods/mod_targo/order_done.phtml index 67bcc27..c0b3faf 100644 --- a/views/mods/mod_targo/order_done.phtml +++ b/views/mods/mod_targo/order_done.phtml @@ -14,15 +14,21 @@ }
?>
-<p><?php echo __('Um den Betrag mit Targo zu bezahlen klicken Sie bitte auf folgendes Logo.', 'wpsg'); ?></p>
+<p><?php echo __('Um den Betrag mit einer Finanzierung bei der TARGOBANK zu bezahlen, klicken Sie bitte auf folgendes Logo.', 'wpsg'); ?></p>
<p>
+<!--
<a title="<?php echo __('Mit Targo bezahlen', 'wpsg'); ?>" href="<?php echo $url; ?>">
- <img src="<?php echo $this->getRessourceURL('gfx/targologo.png'); ?>" align="left" alt="<?php echo __('Mit Targo bezahlen', 'wpsg'); ?>" style="margin-right:7px;">
+ <img src="<?php echo $this->getRessourceURL('gfx/targologo.png'); ?>" align="left" alt="<?php echo __('Finanzierung bei Targo beantragen.', 'wpsg'); ?>" style="margin-right:7px;">
</a>
+-->
</p>
-<form hidden class="wpsg_productform" id="wpsg_produktform" method="post" action="<?php echo $url ?>">
+<form class="wpsg_productform" id="wpsg_produktform" method="post" action="<?php echo $url ?>">
+
+<input type="image" name="image" src="<?php echo $this->getRessourceURL('gfx/targologo.png'); ?>" alt="<?php echo __('Finanzierung bei Targo beantragen.', 'wpsg'); ?>" style="margin-right:7px;">
+
+<div style="display:none;">
<?php $o_id = $this->view['o_id'];
$k_id = $this->view['k_id'];
$oOrder = wpsg_order::getInstance($o_id);
@@ -45,10 +51,14 @@ $street = $oOrder-> getInvoiceStreetClear(true);
$nr = $oOrder-> getInvoiceStreetNr();
-
?>
<?php ?>
-<?php ?>
+<?php
+function toIso($string) {
+ return mb_convert_encoding($string, "ISO-8859-1");
+}
+
+?>
<br /><br />
<b>Obligatorische Daten für Targobank</b><br />
@@ -61,26 +71,50 @@ <b>Optionale Daten für Targobank</b><br />
-<input type="text" id="dealerShopURL" name="dealerShopURL" value="" placeholder="dealerShopURL"><br />
-<input type="text" id="dealerAbortURL" name="dealerAbortURL" value="" placeholder="dealerAbortURL"><br />
+<input type="text" id="dealerShopURL" name="dealerShopURL" value="<?php echo $this->get_option('wpsg_mod_targo_dealerShopURL');?>" placeholder="dealerShopURL"><br />
+<input type="text" id="dealerAbortURL" name="dealerAbortURL" value="<?php echo $this->get_option('wpsg_mod_targo_dealerAbortURL');?>" placeholder="dealerAbortURL"><br />
<input type="text" id="hash" name="hash" value="" placeholder="hash">(hashkey)<br />
<input type="text" id="" name="" value="" placeholder=""><br />
<b>Adressdaten aus Kundendaten</b><br />
-<input type="text" id="surname" name="surname" value="<?php echo $oCustomer->getName();?>" placeholder="surname"><br />
-<input type="text" id="firstname" name="firstname" value="<?php echo $oCustomer->getFirstname();?>" placeholder="firstname"><br />
-<input type="text" id="street" name="street" value="<?php echo $oOrder->getInvoiceStreetClear(true);?>" placeholder="street"><br />
-<input type="text" id="streetnumber" name="streetnumber" value="<?php echo $oOrder->getInvoiceStreetNr();?>" placeholder="streetnumber"><br />
-<input type="text" id="zip" name="zip" value="<?php echo $oCustomer->getZip();?>" placeholder="zip"><br />
-<input type="text" id="city" name="city" value="<?php echo $oCustomer->getCity();?>" placeholder="city"><br />
+<?php
+$titel = $oCustomer->getTitle();
+$isotitel = '';
+if (($titel == "Herr") || ($titel == "Frau")) $isotitel = toIso($titel);
+?>
+<input type="text" id="surname" name="gender" value="<?php echo $isotitel;?>" placeholder="titel"><br />
+<input type="text" id="surname" name="surname" value="<?php echo toIso($oCustomer->getName());?>" placeholder="surname"><br />
+<input type="text" id="firstname" name="firstname" value="<?php echo toIso($oCustomer->getFirstname());?>" placeholder="firstname"><br />
+<input type="text" id="street" name="street" value="<?php echo toIso($oOrder->getInvoiceStreetClear(true));?>" placeholder="street"><br />
+<input type="text" id="streetnumber" name="streetnumber" value="<?php echo toIso($oOrder->getInvoiceStreetNr());?>" placeholder="streetnumber"><br />
+<input type="text" id="zip" name="zip" value="<?php echo toIso($oCustomer->getZip());?>" placeholder="zip"><br />
+<input type="text" id="city" name="city" value="<?php echo toIso($oCustomer->getCity());?>" placeholder="city"><br />
<input type="text" id="telnocode" name="telnocode" value="" placeholder="vorwahl"><br />
-<input type="text" id="telno" name="telno" value="<?php echo $oCustomer->getPhone();?>" placeholder="telno"><br />
-<input type="text" id="birthday" name="birthday" value="<?php echo $oCustomer->getBirthdate("Y-m-d");?>" placeholder="birthday"><br />
-<input type="text" id="email" name="email" value="<?php echo $oCustomer->getEMail();?>" placeholder="email"><br />
+<input type="text" id="telno" name="telno" value="<?php echo toIso($oCustomer->getPhone());?>" placeholder="telno"><br />
+<input type="text" id="birthday" name="birthday" value="<?php
+
+ $dt = $oCustomer->getBirthdate("Y-m-d");
+
+ if ($oCustomer->geb == '0000-00-00' || strtotime($dt) === false)
+ {
+
+ echo '';
+
+ }
+ else
+ {
+
+ echo $oCustomer->getBirthdate("Y-m-d");
+
+ }
+
+?>" placeholder="birthday"><br />
+<input type="text" id="email" name="email" value="<?php echo toIso($oCustomer->getEMail());?>" placeholder="email"><br />
<input type="submit" id="submit" name="submit" value="submit" >
+</div>
</form>
@@ -89,7 +123,8 @@ jQuery(document).ready(function() {
window.setTimeout(function() {
- location.href = "<?php echo $url;?>";
+ //location.href = "<?php echo $url;?>";
+ jQuery('#submit').trigger("click");
}, 1000);
} );
diff --git a/views/mods/mod_targo/settings_edit.phtml b/views/mods/mod_targo/settings_edit.phtml index 412850b..c1e915e 100644 --- a/views/mods/mod_targo/settings_edit.phtml +++ b/views/mods/mod_targo/settings_edit.phtml @@ -31,6 +31,11 @@ <br />
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_dealerShopURL', __('Targo-Dealer-Shop-URL', 'wpsg'), $this->get_option('wpsg_mod_targo_dealerShopURL'), array('help' => 'wpsg_mod_targo_dealerShopURL')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_dealerAbortURL', __('Targo-Dealer-Abort-URL', 'wpsg'), $this->get_option('wpsg_mod_targo_dealerAbortURL'), array('help' => 'wpsg_mod_targo_dealerAbortURL')); ?>
+
+<br />
+
<?php echo wpsg_drawForm_Input('wpsg_mod_targo_gebuehr', __('Gebühr/Rabatt', 'wpsg'), wpsg_ff($this->get_option('wpsg_mod_targo_gebuehr'), true), array('help' => 'wpsg_shippay_gebuehr', 'unit' => $this->get_option('wpsg_currency').' / %')); ?>
<?php echo wpsg_drawForm_Select('wpsg_mod_targo_mwst', __('Mehrwertsteuersatz', 'wpsg'), wpsg_tax_groups(), $this->get_option('wpsg_mod_targo_mwst'), array('help' => 'wpsg_shippay_mwst')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_targo_mwstland', __('Keine MwSt. wenn Land steuerfrei', 'wpsg'), $this->get_option('wpsg_mod_targo_mwstland'), array('help' => 'wpsg_shippay_mwstland')); ?>
diff --git a/views/order/index.phtml b/views/order/index.phtml index b6dc7bd..4af0848 100644 --- a/views/order/index.phtml +++ b/views/order/index.phtml @@ -238,7 +238,8 @@ </td>
<td class="col_products">
- <?php foreach ($oOrder->getOrderProducts() as $oOrderProduct) { ?>
+ <?php $oOrderProducts = $oOrder->getOrderProducts();
+ foreach ($oOrderProducts as $oOrderProduct) { ?>
<?php echo wpsg_translate(__('#1# x <a href="#2#">#3#</a> für je #4#', 'wpsg'),
$oOrderProduct->getCount(),
WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$oOrderProduct->getProductId(),
diff --git a/views/order/view.phtml b/views/order/view.phtml index 9025d12..8df88e7 100644 --- a/views/order/view.phtml +++ b/views/order/view.phtml @@ -38,7 +38,25 @@ </div>
<br />
+ <?php if ($this->hasMod('wpsg_mod_gutschein')) { ?>
+ <?php //if (((array_key_exists('gs', $this->view['basket'])) && ($this->view['basket']['gs']['value'] == 0))) { ?>
+ <a href="" id="LinkGutscheinNeu" onclick="return wpsg_addVoucher(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-plus"></span>
+ <?php echo __("Neuer Gutschein.", "wpsg"); ?>
+ </a><br />
+ <?php //} ?>
+ <?php } ?>
+ <?php if ($this->hasMod('wpsg_mod_discount')) { ?>
+ <?php //if (((array_key_exists('preis_rabatt', $this->view['basket']['sum'])) && ($this->view['basket']['sum']['preis_rabatt'] == 0))) { ?>
+ <a href="" id="LinkRabattNeu" onclick="return wpsg_addDiscount(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-plus"></span>
+ <?php echo __("Neuer Rabatt.", "wpsg"); ?>
+ </a><br />
+ <?php //} ?>
+ <?php } ?>
+
+
+ <div id='wpsg_kv_list'>
+ </div>
</div>
<div class="wpsg_admin_content form-horizontal">
@@ -57,6 +75,50 @@ <script type="text/javascript">/* <![CDATA[ */
+
+ /**
+ * Fügt einen neuen Rabatt hinzu (nur wenn keiner da ist)
+ */
+ function wpsg_addDiscount(oid)
+ {
+ jQuery('#wpsg_produkte_table').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=discountData&do=add&edit_id=' + oid + '&noheader=1',
+ success: function(data) {
+ jQuery('#wpsg_produkte_table').replaceWith(data);
+ jQuery('#LinkRabattNeu').hide();
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_addRabatt()
+
+
+ /**
+ * Fügt einen neuen Gutschein hinzu (nur wenn keiner da ist)
+ */
+ function wpsg_addVoucher(oid)
+ {
+ jQuery('#wpsg_produkte_table').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=voucherData&do=add&edit_id=' + oid + '&noheader=1',
+ success: function(data) {
+ jQuery('#wpsg_produkte_table').replaceWith(data);
+ jQuery('#LinkGutscheinNeu').hide();
+ //jQuery('#wpsg_kv_list').html(data);
+ //location.href = location.href;
+ //jQuery('#wpsg_kv_list').html('');
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_addVoucher()
+
+
jQuery(document).ready(function() {
jQuery('#wpsg_order_view_tabs a.list-group-item').bind('click', function() {
diff --git a/views/order/view_orderdata.phtml b/views/order/view_orderdata.phtml index 0ea8f1a..c031b35 100644 --- a/views/order/view_orderdata.phtml +++ b/views/order/view_orderdata.phtml @@ -7,7 +7,7 @@ */
?>
-
+<div id="wpsg_produkte_table">
<?php echo wpsg_drawForm_AdminboxStart(__('Bestelldaten', 'wpsg')); ?>
<table class="wpsg_produkte table">
<tr class="wpsg_kopf">
@@ -47,10 +47,29 @@ <?php } ?>
<?php $this->callMods('order_view_row', array(&$p, $i)); ?>
<?php } ?>
- <?php if (isset($this->view['basket']['gs'])) { ?>
+ <?php $gs_id = 0;
+ if ((isset($this->view['basket']['gs'])) && ($this->view['basket']['gs']['value'] > 0)) { ?>
<tr class="wpsg_<?php echo (($i % 2 == 0)?'odd':'even'); ?> wpsg_gutschein">
- <td class="wpsg_cell_name"><?php echo __('Gutschein', 'wpsg'); ?> <?php echo ($this->view['basket']['gs']['code'] != '')? '('.$this->view['basket']['gs']['code'].')':'' ?></td>
- <td class="wpsg_cell_preis"><?php echo '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency')); ?></td>
+ <?php
+ $gs_id = 0;
+ if (array_key_exists('gs_id', $_REQUEST))
+ {
+ $gs_id = wpsg_getInt($_REQUEST['gs_id']);
+ }
+ else
+ {
+ $gs_id = wpsg_getInt($this->view['data']['gs_id']);
+ }
+ $o_id = $_REQUEST['edit_id'];
+ $link1 = '<span id="gsname_'.$gs_id.'" class="editable editable-click" data-original-title="" title="">'.$this->view['basket']['gs']['code'].'</span>';
+ $val = '-'.wpsg_ff($this->view['basket']['sum']['gs']);
+ $link2 = '<span id="gsvalue_'.$gs_id.'" class="editable editable-click" data-original-title="" title="">'.$val.'</span>';
+
+ ?>
+ <td class="wpsg_cell_name"><?php echo __('Gutschein', 'wpsg'); ?> <?php echo ($this->view['basket']['gs']['code'] != '')? '('.$link1.')':'' ?>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Gutschein löschen', 'wpsg'); ?>" onclick="return wpsg_removeVoucher(<?php echo $gs_id; ?>, <?php echo $o_id; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
+ </td>
+ <td class="wpsg_cell_preis"><?php echo $link2.' '.$this->get_option('wpsg_currency'); ?></td>
<?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
<td class="wpsg_cell_mwst"><?php echo __('anteilig', 'wpsg'); ?></td>
<?php } ?>
@@ -58,13 +77,19 @@ <td class="wpsg_cell_gesamtpreis"><?php echo '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency')); ?></td>
</tr>
<?php } ?>
- <?php if (isset($this->view['basket']['sum']['preis_rabatt']) && $this->view['basket']['sum']['preis_rabatt'] > 0) { ?>
+ <?php $prval = 0;
+ if (isset($this->view['basket']['sum']['preis_rabatt']) && $this->view['basket']['sum']['preis_rabatt'] > 0) {
+ $o_id = $_REQUEST['edit_id'];
+ $prval = '-'.wpsg_ff($this->view['basket']['sum']['preis_rabatt']);
+ $link2 = '<span id="discountvalue_'.$o_id.'" class="editable editable-click" data-original-title="" title="">'.$prval.'</span>';
+ ?>
<tr class="wpsg_<?php echo (($i % 2 == 0)?'odd':'even'); ?> wpsg_row_rabatt">
<td colspan="<?php echo $this->view['colspan']; ?>" class="wpsg_cell_rabatt_label">
<?php echo __('Abzüglich Rabatt', 'wpsg'); ?>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Rabatt löschen', 'wpsg'); ?>" onclick="return wpsg_removeDiscount(<?php echo $o_id; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
</td>
<td class="wpsg_cell_rabatt_value wpsg_cell_gesamtpreis">
- <?php echo '-'.wpsg_ff($this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')); ?>
+ <?php echo $link2.' '.$this->get_option('wpsg_currency'); ?>
</td>
</tr>
<?php } ?>
@@ -73,7 +98,9 @@ <?php if ($this->get_option('wpsg_kleinunternehmer') == '1') { ?>
<?php echo wpsg_translate(__('Summe (zzgl. #1#)', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'" target="_blank">'.__('Versandkosten', 'wpsg').'</a>'); ?>
<?php } else { ?>
- <?php if ($this->getFrontendTaxview() == WPSG_NETTO) { ?>
+ <?php //if ($this->getFrontendTaxview() == WPSG_NETTO)
+ if ($this->view['basket']['price_frontend'] == WPSG_NETTO)
+ { ?>
<?php echo wpsg_translate(__('Summe (zzgl. #1#, zzgl. MwSt.)', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'" target="_blank">'.__('Versandkosten', 'wpsg').'</a>'); ?>
<?php } else { ?>
<?php echo wpsg_translate(__('Summe (zzgl. #1#, inkl. MwSt.)', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'" target="_blank">'.__('Versandkosten', 'wpsg').'</a>'); ?>
@@ -97,7 +124,13 @@ <?php if ($this->view['basket']['sum']['preis_payment'] != 0 || $this->get_option('wpsg_hideemptypayment') != '1') { ?>
<tr class="wpsg_row_payment">
<td colspan="<?php echo $this->view['colspan']; ?>" class="wpsg_cell_payment_label">
- <?php echo __('Zahlungsart', 'wpsg'); ?>
+ <?php echo __('Zahlungsart', 'wpsg');
+ //$order = $this->view['oOrder'];
+ $oOrder = wpsg_order::getInstance($_REQUEST['edit_id']);
+ $pid = $oOrder->getPaymentID();
+ echo __(' ('.$this->arPayment[$pid]['name'].')', 'wpsg');
+ ?>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Zahlungsart ändern', 'wpsg'); ?>" onclick="return WPSG_BE_Payment.changePayment(<?php echo $pid; ?>, <?php echo $o_id; ?>);"><span class="glyphicon glyphicon-modal-window"></span></a>
</td>
<td class="wpsg_cell_payment_value wpsg_cell_gesamtpreis">
<?php echo wpsg_ff($this->view['basket']['sum']['preis_payment']); ?> <?php echo $this->get_option('wpsg_currency'); ?>
@@ -121,7 +154,7 @@ <?php echo __('Gesamtpreis', 'wpsg'); ?>
</td>
<td class="wpsg_cell_gesamt_value wpsg_cell_gesamtpreis">
- <strong><?php echo wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto']); ?> <?php echo $this->get_option('wpsg_currency'); ?></strong>
+ <strong><?php echo wpsg_ff($this->view['basket']['sum']['preis_gesamt']); ?> <?php echo $this->get_option('wpsg_currency'); ?></strong>
</td>
</tr>
<?php if ($this->get_option('wpsg_kleinunternehmer') == '1' || $this->get_option('wpsg_preisangaben') != '1') { ?>
@@ -131,7 +164,11 @@ <?php if ($this->get_option('wpsg_kleinunternehmer') == '1') { ?>
<?php echo $this->get_option('wpsg_kleinunternehmer_text'); ?>
<?php } else { ?>
- <?php echo wpsg_translate(__('darin enthaltene MwSt. (#1#)', 'wpsg'), $mwst['name']); ?>
+ <?php if ($this->view['basket']['price_frontend'] == WPSG_NETTO) {
+ echo wpsg_translate(__('zuzüglich MwSt. (#1#)', 'wpsg'), $mwst['name']);
+ } else {
+ echo wpsg_translate(__('darin enthaltene MwSt. (#1#)', 'wpsg'), $mwst['name']); ?>
+ <?php } ?>
<?php } ?>
</td>
<td class="wpsg_cell_mwst_value wpsg_cell_gesamtpreis">
@@ -141,4 +178,296 @@ <?php } ?>
<?php } ?>
</table>
-<?php echo wpsg_drawForm_AdminboxEnd(); ?>
\ No newline at end of file +
+
+<script type="text/javascript">/* <![CDATA[ */
+
+<?php if ($this->hasMod('wpsg_mod_gutschein')) { ?>
+ <?php if ((array_key_exists('gs', $this->view['basket'])) && ($this->view['basket']['gs']['value'] > 0)) { ?>
+
+ jQuery('#gsname_<?php echo $gs_id; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=voucherData&do=editname&noheader=1', {
+ submitdata: {
+ field: 'code',
+ gs_id: '<?php echo $gs_id; ?>',
+ edit_id: '<?php echo $o_id; ?>'
+ },
+ submit : '<?php echo __('Speichern', 'wpsg'); ?>',
+ placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+ indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+ tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+ callback: function(data, config) {
+ jQuery('#wpsg_produkte_table').replaceWith(data);
+ }
+ });
+
+ jQuery('#gsvalue_<?php echo $gs_id; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=voucherData&do=editvalue&noheader=1', {
+ submitdata: {
+ field: 'value',
+ gs_id: '<?php echo $gs_id; ?>',
+ edit_id: '<?php echo $o_id; ?>',
+ noMwSt: '<?php echo $this->view['basket']['noMwSt']; ?>',
+ mwst: '<?php reset($this->view['basket']['mwst']); echo key($this->view['basket']['mwst']); ?>',
+ price_frontend: '<?php echo $this->view['basket']['price_frontend']; ?>'
+ },
+ submit : '<?php echo __('Speichern', 'wpsg'); ?>',
+ placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+ indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+ tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+ callback: function(data, config) {
+ jQuery('#wpsg_produkte_table').replaceWith(data);
+ }
+ });
+
+ <?php } ?>
+<?php } ?>
+
+<?php if ($this->hasMod('wpsg_mod_discount')) { ?>
+ <?php if (isset($this->view['basket']['sum']['preis_rabatt']) && $this->view['basket']['sum']['preis_rabatt'] > 0) { ?>
+
+ jQuery('#discountvalue_<?php echo $o_id; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=discountData&do=editvalue&noheader=1', {
+ submitdata: {
+ field: 'value',
+ edit_id: '<?php echo $o_id; ?>',
+ noMwSt: '<?php echo $this->view['basket']['noMwSt']; ?>',
+ mwst: '<?php reset($this->view['basket']['mwst']); echo key($this->view['basket']['mwst']); ?>',
+ price_frontend: '<?php echo $this->view['basket']['price_frontend']; ?>'
+ },
+ submit : '<?php echo __('Speichern', 'wpsg'); ?>',
+ placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+ indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+ tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+ callback: function(data, config) {
+ jQuery('#wpsg_produkte_table').replaceWith(data);
+ }
+ });
+
+ <?php } ?>
+<?php } ?>
+
+ /**
+ * Wird aufgerufen wenn ein Gutschein gelöscht werden soll
+ */
+ function wpsg_removeVoucher(gs_id, o_id)
+ {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass sie diesen Gutschein löschen möchten?', 'wpsg'); ?>')) return false;
+
+ jQuery('#wpsg_produkte_table').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=voucherData&do=remove&gs_id=' + gs_id + '&edit_id=' + o_id +'&noheader=1',
+ success: function(data) {
+ jQuery('#wpsg_produkte_table').replaceWith(data);
+ jQuery('#LinkGutscheinNeu').show();
+ }
+ } );
+
+ return false;
+ }
+
+ /**
+ * Wird aufgerufen wenn ein Rabatt gelöscht werden soll
+ */
+ function wpsg_removeDiscount(o_id)
+ {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass sie diesen Rabatt löschen möchten?', 'wpsg'); ?>')) return false;
+
+ jQuery('#wpsg_produkte_table').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=discountData&do=remove&edit_id=' + o_id +'&noheader=1',
+ success: function(data) {
+ jQuery('#wpsg_produkte_table').replaceWith(data);
+ jQuery('#LinkRabattNeu').show();
+ }
+ } );
+
+ return false;
+ }
+
+ jQuery(document).ready(function() {
+ gs_id = <?php echo $gs_id; ?>;
+ prval = <?php echo $prval; ?>;
+
+ if (gs_id > 0) { jQuery('#LinkGutscheinNeu').hide(); }
+ if (prval != 0) { jQuery('#LinkRabattNeu').hide(); }
+
+ } );
+
+
+ var Modul2 = {
+ eigenschaft : "wert",
+ methode : function () {
+ alert("Modul-Eigenschaft (über window.Modul): " + Modul2.eigenschaft);
+ // Alternativ:
+ alert("Modul-Eigenschaft (über this): " + this.eigenschaft);
+ }
+ };
+ //Modul2.methode();
+
+
+ var WPSG_BE_Payment = {
+
+ paymentinfos: 0,
+ pidold: 0,
+ oid: 0,
+
+ changePayment: function (id, oid) {
+
+ //alert('TEST OK neu');
+
+ //jQuery('#wpsg_payment_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery('#wpsg_payment_dialog').modal( { } )
+
+ /*
+ jQuery.ajax({
+ url: 'admin.php?page=wpsg-Admin&subaction=kundendaten&noheader=1&show=code',
+ data: { 'kv_id': index },
+ success: function(data) { jQuery('#wpsg_payment_dialog .modal-body').html(data); }
+ });
+ */
+
+ this.paymentinfos = <?php echo json_encode($this->arPayment, JSON_FORCE_OBJECT); ?>;
+ this.oid = oid;
+ this.pidold = id;
+
+ jQuery('#zahlungsartid').empty();
+ jQuery.each(this.paymentinfos, function(i,n) {
+ console.log('element: ', n.name);
+ if (id == n.id) {
+ jQuery('#zahlungsartid').append('<option value=' + n.id + ' "selected"="selected">' + n.name + '</option>');
+ } else {
+ jQuery('#zahlungsartid').append('<option value=' + n.id + '>' + n.name + '</option>');
+ }
+ });
+
+ preis = this.paymentinfos[id].preis;
+ if (preis == false) { preis = '0,00'; }
+ jQuery('#zahlungsartvalue').val(preis);
+
+ return false;
+
+ }, // function changePayment(id, oid)
+
+ /**
+ * Ändern der Zahlungsdaten im Backend
+ */
+ dialog_OK: function() {
+ var
+ pid,
+ pval;
+
+ pid = jQuery('#zahlungsartid').val();
+ pval = jQuery('#zahlungsartvalue').val();
+ alert('OK neu: ' + this.pidold + ' / ' + pid + ' / ' + pval);
+ //TODO vergleichen oder nicht
+ if (this.pidold == pid) {
+ jQuery('#wpsg_payment_dialog').modal('hide');
+ return false;
+ }
+ alert('OK neu: ' + pid + ' / ' + pval);
+ //TODO price_frontend
+ //TODO Frontend-Rabatt/Frontend-Gutschein bei Firmenkunde in Netto oder Brutto in der Datenbank?
+
+ //TODO
+ //field: 'value',
+ //gs_id: '<?php echo $gs_id; ?>',
+ //edit_id: '<?php echo $o_id; ?>',
+ //noMwSt: '<?php echo $this->view['basket']['noMwSt']; ?>',
+ //mwst: '<?php reset($this->view['basket']['mwst']); echo key($this->view['basket']['mwst']); ?>',
+ //price_frontend: '<?php echo $this->view['basket']['price_frontend']; ?>'
+ //data: { name: "John", location: "Boston" }
+
+ data1: {
+ //price_frontend: '<?php echo $this->view['basket']['price_frontend']; ?>',
+ //noMwSt: '<?php echo $this->view['basket']['noMwSt']; ?>'
+ }
+
+ url1 = 'wp-admin/admin.php?page=wpsg-Admin&subaction=paymentData&do=change&edit_id=' + this.oid + '&p_id=' + pid + '&p_value=' + pval + '&noheader=1';
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>' + url1,
+ dataType: 'json',
+ data: {
+ price_frontend: '<?php echo $this->view['basket']['price_frontend']; ?>',
+ noMwSt: '<?php echo $this->view['basket']['noMwSt']; ?>' },
+ method: 'POST',
+ success: function(data) {
+ jQuery('#wpsg_produkte_table').replaceWith(data);
+ }
+ } );
+
+ return false;
+
+ }, // function dialog_OK()
+
+ /**
+ * Ändern der Zahlungsdaten im Backend
+ */
+ dialog_change: function() {
+ var
+ pid,
+ pval;
+ pid = jQuery('#zahlungsartid').val();
+ pval = this.paymentinfos[pid].preis;
+ jQuery('#zahlungsartvalue').val(pval);
+
+
+ }, // dialog_change()
+
+
+ changePayment2: function (id, oid) {
+
+ alert('TEST OK neu2');
+
+ } // function wpsg_changePayment2(id, oid)
+
+ }; // WPSG_BE_Payment
+ //WPSG_BE_Payment.changePayment2(1, 2);
+
+
+ /* ]]> */</script>
+
+
+</div>
+
+<!-- Modaldialog für Zahlungsart -->
+<div class="modal fade" id="wpsg_payment_dialog" tabindex="-1" role="dialog">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
+ <h4 class="modal-title" id="myModalLabel"><?php echo __('Zahlungsart', 'wpsg'); ?></h4>
+ </div>
+ <div class="modal-body">
+ <br />
+ <div class="row">
+ <div class="col-md-3 col-sm-6 control_label"><label for="zahlungsartid" ><?php echo _("Zahlungsart"); ?></label></div>
+ <div class="col-md-3">
+ <select name="zahlungsartid" id="zahlungsartid" onchange="return WPSG_BE_Payment.dialog_change();" class="form-control input-sm" size="1" class="select">
+ <option value=0>"[unbekannt]"</option>
+ </select>
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ <div class="clearfix wpsg_clear"></div>
+ <br />
+ <div class="row">
+ <div class="col-md-3 col-sm-6 control_label"><label for="zahlungsartvalue"><?php echo _("Gebühr/Kosten"); ?></label></div>
+ <div class="col-md-3">
+ <input type="text" name="zahlungsartvalue" id="zahlungsartvalue" class="form-control input-sm" size="1" class="select">
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">Abbrechen</button>
+ <button type="button" class="btn btn-primary" onclick="return WPSG_BE_Payment.dialog_OK();">OK</button>
+ </div>
+ </div>
+ </div>
+</div>
+
+<?php echo wpsg_drawForm_AdminboxEnd(); ?>
diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml index ff68461..97b66c7 100644 --- a/views/produkttemplates/standard.phtml +++ b/views/produkttemplates/standard.phtml @@ -73,7 +73,7 @@ <?php echo wpsg_ff($this->view['data']['preis'], $this->get_option('wpsg_currency')); ?>
</span> <?php if (wpsg_isSizedString($this->view['data']['price_info'])) { echo '<div class="wpsg_priceinfo">'.wpsg_hspc($this->view['data']['price_info']).'</div>'; } ?>
- <?php if ($this->hasMod('wpsg_mod_discount') && $this->view['data']['preis_prediscount'] > 0 && wpsg_isSizedInt($this->get_option('wpsg_mod_discount_show'))) { ?>
+ <?php if ($this->hasMod('wpsg_mod_discount') && wpsg_getInt($this->view['data']['preis_prediscount']) > 0 && wpsg_isSizedInt($this->get_option('wpsg_mod_discount_show'))) { ?>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="wpsg_produkt_preis new_price">
<?php echo __('Originalpreis', 'wpsg'); ?>: <span class="wpsg_preis_prediscount"><?php echo wpsg_ff($this->view['data']['preis_prediscount'], $this->get_option('wpsg_currency')); ?></span>
</div>
diff --git a/views/warenkorb/checkout.phtml b/views/warenkorb/checkout.phtml index fd3d585..0d4899f 100644 --- a/views/warenkorb/checkout.phtml +++ b/views/warenkorb/checkout.phtml @@ -281,6 +281,22 @@ } );
} );
+
+ <?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 |
