From e96b183e33afb4038b2e39868f32ebf94a59ba83 Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Wed, 31 Jul 2019 18:54:21 +0000 Subject: - Gutschein/Coupon - Task #681 git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7490 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/order/backendEdit/addVoucher.phtml | 16 +++++++++++++--- views/order/product_table.phtml | 2 +- views/order/view.phtml | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'views/order') diff --git a/views/order/backendEdit/addVoucher.phtml b/views/order/backendEdit/addVoucher.phtml index 88d8e2b..497b4c4 100644 --- a/views/order/backendEdit/addVoucher.phtml +++ b/views/order/backendEdit/addVoucher.phtml @@ -19,24 +19,31 @@ 'code' => '', 'id' => 0, 'set' => 0, - 'type' => 'voucher' + 'type' => 'voucher', ]; + //wpsg_debug(array_merge($arCalculation['voucher'], $arCalculation['coupon'])); + //wpsg_Debug($_REQUEST); + // Voucher suchen foreach (array_merge($arCalculation['voucher'], $arCalculation['coupon']) as $v) { if ($v['order_voucher_id'] == $_REQUEST['order_voucher_id']) { + + $order_voucher_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_ORDER_VOUCHER."` WHERE `id` = '".wpsg_q($_REQUEST['order_voucher_id'])."' "); $voucher = $v; + //if ($order_voucher_db['coupon'] === '1') $voucher['type'] = 'coupon'; + } } $strVal = ((isset($voucher['set']))?$voucher['set']:0); - if (strpos($strVal, '%') !== false) $strVal = wpsg_ff(wpsg_tf($strVal), '%'); - else $strVal = wpsg_ff(wpsg_tf($strVal), $this->get_option('wpsg_currency')); + if (strpos($strVal, '%') !== false) $strVal = wpsg_ff(abs(wpsg_tf($strVal)), '%'); + else $strVal = wpsg_ff(abs(wpsg_tf($strVal)), $this->get_option('wpsg_currency')); ?> @@ -74,6 +81,9 @@ jQuery('#be_voucher_id').val(ui.item.id); jQuery('#be_voucher_amount').val(ui.item.gs_value); + if (ui.item.coupon === '1') jQuery('#be_voucher_coupon').prop('checked', true); + else jQuery('#be_voucher_coupon').prop('checked', false); + jQuery('#be_voucher_search').val(''); return false; diff --git a/views/order/product_table.phtml b/views/order/product_table.phtml index 244ee56..0eb1666 100644 --- a/views/order/product_table.phtml +++ b/views/order/product_table.phtml @@ -387,5 +387,5 @@ - + \ No newline at end of file diff --git a/views/order/view.phtml b/views/order/view.phtml index e275f50..fd0670c 100644 --- a/views/order/view.phtml +++ b/views/order/view.phtml @@ -69,7 +69,7 @@ hasMod('wpsg_mod_gutschein')) { ?> - + -- cgit v1.2.3