summaryrefslogtreecommitdiff
path: root/views/order/backendEdit/addVoucher.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'views/order/backendEdit/addVoucher.phtml')
-rw-r--r--views/order/backendEdit/addVoucher.phtml16
1 files changed, 13 insertions, 3 deletions
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;