Skip to content

Commit

Permalink
Control Panel : Coupon large total issue fix. #162
Browse files Browse the repository at this point in the history
  • Loading branch information
abolabo committed Jul 16, 2015
1 parent 518370e commit f018e1d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion public_html/admin/controller/pages/sale/coupon.php
Expand Up @@ -210,7 +210,10 @@ public function insert() {
$this->load->library('json');
if ( $this->request->is_POST() && $this->_validateForm()) {
if (has_value($this->request->post[ 'date_start' ])) {
$this->request->post[ 'date_start' ] = dateDisplay2ISO($this->request->post[ 'date_start' ],$this->language->get('date_format_short'));
$this->request->post[ 'date_start' ] = dateDisplay2ISO(
$this->request->post[ 'date_start' ],
$this->language->get('date_format_short')
);
}
if (has_value($this->request->post[ 'date_end' ])) {
$this->request->post[ 'date_end' ] = dateDisplay2ISO($this->request->post[ 'date_end' ],$this->language->get('date_format_short'));
Expand All @@ -219,6 +222,8 @@ public function insert() {
}
}

$this->request->post['discount'] = preformatFloat($this->request->post['discount'], $this->language->get('decimal_point') );

$coupon_id = $this->model_sale_coupon->addCoupon($this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->redirect($this->html->getSecureURL('sale/coupon/update', '&coupon_id=' . $coupon_id));
Expand Down Expand Up @@ -253,6 +258,8 @@ public function update() {
}
}

$this->request->post['discount'] = preformatFloat($this->request->post['discount'], $this->language->get('decimal_point') );

$this->model_sale_coupon->editCoupon($this->request->get['coupon_id'], $this->request->post);
$this->model_sale_coupon->editCouponProducts($this->request->get['coupon_id'], $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
Expand Down
Expand Up @@ -149,6 +149,11 @@ public function update_field() {
if(in_array($field,array('date_start', 'date_end'))){
$value = dateDisplay2ISO($value);
}

if( $field=='discount'){
$value = preformatFloat($value, $this->language->get('decimal_point') );
}

if ( !$err ) {
$this->model_sale_coupon->editCoupon($this->request->get['id'], array( $field => $value) );
} else {
Expand Down

0 comments on commit f018e1d

Please sign in to comment.