summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2019-10-25 08:22:44 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2019-10-25 08:22:44 +0000
commit01b391fc3fc32fd17a8999257e7ce6302eaed843 (patch)
treeaae6e53b731ac3479253507f96221c331ddcd1dd
parentb843f60bf2e339cb026887887beb0e5ade3125f9 (diff)
- Feature: Gutscheinprodukte - Preis für den Gutschein kann vom Kunden frei definiert werden
- Feature: Gutscheinprodukte - Optionale Mindest- und Maximalschranken für den Flexiblen Preis git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7589 0d5edaf7-2b12-4e95-93f4-047927463d4b
-rw-r--r--views/mods/mod_voucherproduct/product_bottom.phtml33
-rw-r--r--views/mods/mod_voucherproduct/produkt_edit_sidebar.phtml19
-rw-r--r--views/produkttemplates/standard.phtml2
3 files changed, 53 insertions, 1 deletions
diff --git a/views/mods/mod_voucherproduct/product_bottom.phtml b/views/mods/mod_voucherproduct/product_bottom.phtml
new file mode 100644
index 0000000..2acbec6
--- /dev/null
+++ b/views/mods/mod_voucherproduct/product_bottom.phtml
@@ -0,0 +1,33 @@
+<?php
+
+ declare(strict_types=1);
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 25.10.2019
+ * Time: 09:35
+ */
+
+ /** @var wpsg_product $oProduct */
+ $oProduct = $this->view['oProduct'];
+
+ $min = wpsg_tf($oProduct->__get('wpsg_mod_voucherproduct_flexprice_min'));
+ $max = wpsg_tf($oProduct->__get('wpsg_mod_voucherproduct_flexprice_max'));
+
+ if ($min > 0 && $max > 0) $strInterval = __('#1# bis #2# #3#', 'wpsg');
+ else if ($min > 0) $strInterval = __('Mindestens #1# #3#', 'wpsg');
+ else if ($max > 0) $strInterval = __('Maximal #2# #3#', 'wpsg');
+ else throw new \Exception(__('Systemfehler'));
+
+ $strInterval = wpsg_translate($strInterval, wpsg_ff($min), wpsg_ff($max), $this->get_option('wpsg_currency'));
+
+?>
+
+<div class="wpsg_product_buttonarea">
+ <label>
+ <strong><?php echo wpsg_translate(__('Gutscheinwert (#1#)', 'wpsg'), $strInterval); ?></strong><br />
+ <input class="wpsg_menge" type="text" name="wpsg_mod_voucherproduct_value" />
+ </label>
+</div>
+
+<div class="wpsg_clear"></div><br />
diff --git a/views/mods/mod_voucherproduct/produkt_edit_sidebar.phtml b/views/mods/mod_voucherproduct/produkt_edit_sidebar.phtml
index 6181b11..65ad306 100644
--- a/views/mods/mod_voucherproduct/produkt_edit_sidebar.phtml
+++ b/views/mods/mod_voucherproduct/produkt_edit_sidebar.phtml
@@ -22,6 +22,25 @@
<?php echo wpsg_drawForm_Input('wpsg_mod_voucherproduct_gslaenge', __('Länge des Gutscheincodes', 'wpsg'), (($this->view['data']['wpsg_mod_voucherproduct_gslaenge'] > 0)?$this->view['data']['wpsg_mod_voucherproduct_gslaenge']:10)); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_voucherproduct_available', __('Gültigkeit (Tage)', 'wpsg'), $this->view['data']['wpsg_mod_voucherproduct_available']); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_voucherproduct_coupon', __('Gutschein als Wertgutschein generieren', 'wpsg'), $this->view['data']['wpsg_mod_voucherproduct_coupon']); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_voucherproduct_flexprice', __('Flexibler Preis', 'wpsg'), $this->view['data']['wpsg_mod_voucherproduct_flexprice']); ?>
+
+ <div class="wpsg_mod_voucherproduct_flexprice_layer wpsg_mod_voucherproduct_flexprice_layer_1" style="display:none;">
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_voucherproduct_flexprice_min', __('Minimaler Preis', 'wpsg'), ((wpsg_tf($this->view['data']['wpsg_mod_voucherproduct_flexprice_min']) > 0)?wpsg_ff($this->view['data']['wpsg_mod_voucherproduct_flexprice_min']):'')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_voucherproduct_flexprice_max', __('Maximaler Preis', 'wpsg'), ((wpsg_tf($this->view['data']['wpsg_mod_voucherproduct_flexprice_max']) > 0)?wpsg_ff($this->view['data']['wpsg_mod_voucherproduct_flexprice_max']):'')); ?>
+
+ </div>
+
+ <script>
+
+ jQuery('#wpsg_mod_voucherproduct_flexprice').on('change', function() {
+
+ jQuery('.wpsg_mod_voucherproduct_flexprice_layer').hide();
+ jQuery('.wpsg_mod_voucherproduct_flexprice_layer_' + ((jQuery(this).prop('checked') === true)?'1':'0')).show();
+
+ }).change();
+
+ </script>
</div>
diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml
index 190ac53..af69356 100644
--- a/views/produkttemplates/standard.phtml
+++ b/views/produkttemplates/standard.phtml
@@ -283,7 +283,7 @@
<?php $this->callMods('product_bottom', array(&$this->view['data']['product_key'], $this->getTemplateIndex())); ?>
- <div class="wpsg_product_buttonarea">
+ <div class="wpsg_product_buttonarea">
<div class="wpsg_product_buttons_add_basket">
<?php if ($this->view['oProduct']->canOrder()) { ?>
<div class="wpsg_produkt_add_basket_wrapper">