Hi,
I am using OC version 2.1.0.2
All customers can use succesfully a Coupon Code, it works just fine.
But I cannot change order history in admin area for people who used a coupon code.
It doesn't matter what status I give in admin area, it goes automatically to Canceled.
How is this possible? No problems with orders without the use of coupon code.
Problem solved, I followed this:
https://github.com/opencart/opencart/is ... -174047947
https://github.com/opencart/opencart/is ... -174047947
qphoria wrote:
I think this is a problem actually. Basically if a coupon is used already, it triggers the "fraud order id", even if it is being edited from the admin side. It is a side effect of how the admin order edit uses the api to login and apply the changes as if it is doing it from the front end.
It is caused by this code in catalog/model/total/coupon.php:
Which is because you are trying to catch people hacking coupons. At the very least, this should be ignored when editing the order from the admin, otherwise admins can't change the order history because the coupon is trying to be reconfirmed after it already has been.Code: Select all
if ($coupon_info) { $this->db->query("INSERT INTO `" . DB_PREFIX . "coupon_history` SET coupon_id = '" . (int)$coupon_info['coupon_id'] . "', order_id = '" . (int)$order_info['order_id'] . "', customer_id = '" . (int)$order_info['customer_id'] . "', amount = '" . (float)$order_total['value'] . "', date_added = NOW()"); } else { return $this->config->get('config_fraud_status_id'); }
Quick fix, Just remove the else portion of that.
A more proper fix would be to add something to the session that shows that the order is being placed from the admin. It looks like there is already a temp_session_xxx variable created when logging in, but since that uses a unique id, you'd have to iterate over the session variable to see if it exists. Perhaps a simple flat variable like $this->session->data['is_admin'] = 1
Who is online
Users browsing this forum: No registered users and 39 guests