2016-10-14 33 views
0

我有opencart 2.0.1.1,我面臨的一個問題是,讓我的商店的顧客有500個獎勵積分,並通過使用購買產品的順序100個獎勵積分。訂單被放置,但當相同的用戶再次下訂單時,它仍然向該客戶顯示500個獎勵點,直到商店的管理員更改該客戶的先前訂單的狀態以完成。 我發現這個鏈接與我的問題相同,但他使用的解決方案並不能解決我的問題。另外我還沒有在opencart論壇上找到任何解決方案。任何幫助?opencart 2.0.1.1 - 訂購時不會扣減獎勵積分

https://github.com/opencart/opencart/issues/3637 

UPDATE:

我想我需要修改插入查詢在此確認()函數在這個文件catalog/model/total/reward.php。我在上面,但任何幫助將不勝感激!

public function confirm($order_info, $order_total) { 
     $this->load->language('total/reward'); 

     $points = 0; 

     $start = strpos($order_total['title'], '(') + 1; 
     $end = strrpos($order_total['title'], ')'); 

     if ($start && $end) { 
      $points = substr($order_total['title'], $start, $end - $start); 
     } 

     if ($points) { 
      $this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$order_info['customer_id'] . "', order_id = '" . (int)$order_info['order_id'] . "', description = '" . $this->db->escape(sprintf($this->language->get('text_order_id'), (int)$order_info['order_id'])) . "', points = '" . (float)-$points . "', date_added = NOW()"); 
     } 
    } 
+2

您需要修改客戶庫文件並更改獎勵點計算。在實施之前,還要先製作一些場景。如果訂單已取消等,請添加獎勵積分。 –

+1

@Vidhyut Pandya先生,我更新了我的問題。我需要插入查詢,它應該在下訂單後插入使用的獎勵點數,以便從總數中扣除,但只有在訂單狀態更改爲完成時纔會扣除 – Haroon

回答

0

問題是通過更改默認的訂單狀態到處理解決。 在默認訂單狀態爲待定之前,由於未扣除獎勵積分。因此,僅在訂單狀態未處於待定狀態時扣除獎勵積分。 問題解決了!