客户订单未受客户约束
Postby DrFeeling»2015年6月1日星期一下午4:05 下午好,我正在为opencart开发移动应用程序,这将结合两种技术。
大多数内容已经处于活动状态,但我在订单历史方面存在问题。
因此,当您通过主站点购买opencart的默认模板时,它会生成订单历史记录,您可以通过网站(我的订单)或管理页面查看。
我的问题是,每当有人从应用程序购买东西时,该客户的订单都不会被提升。 虽然它们出现在主管理窗口(仪表板)中,但一旦您转到客户(销售 - >客户 - >客户),该应用程序所做的订单就不会列在该客户的myOrders部分中,从而使其成为“我的”之前的订单“以及该客户在该地方不存在的订单,但它们出现在仪表板中,通知电子邮件向客户转发
请帮帮我,谢谢你的支持:D
只有订单261(在网站上制作)与其客户有关,其他订单不在,如下图所示
AM我在结账过程中错过了参数或验证?
http://s16.postimg.org/y2h9rg5fp/image.jpg
编辑:我创建订单的代码: public function end_order(){
if ($this->customer->isLogged() == true){
$data= array();
$datap = array();
$this->load->model('account/customer');
$this->load->model('quickcheckout/order');
$this->load->model('checkout/order');
$myArray = $_POST["formData"];
$treatedArray = array();
foreach($myArray as $value) {
$treatedArray[$value['name']] = $value['value'];
}
$email = $_POST["email"];
$delivery = $_POST["deladdress"];
$delivery = array_shift($delivery); // sobe um nivel as posiçoes do array, em vez de usar $array[0]['bla'] , usasse so $array['bla']
$data2 = array();
$data2 = $this->model_account_customer->getCustomerByEmail($email);
$Method = $_POST["PayMethod"];
$TotalCheckout = $_POST["TotalCheck"];
$IP = $_POST["IP"];
$Agent = $_POST["User"];
$Products = $_POST["Prod"];
$length = count($Products);
for ($i = 0; $i < $length; $i++) {
(int)$datap[$i]['product_id'] = $Products[$i]['Id'];
$datap[$i]['name'] = $Products[$i]['Name'];
$datap[$i]['model'] = $Products[$i]['modelo'];
(int)$datap[$i]['quantity'] = $Products[$i]['NItems'];
$datap[$i]['price'] = $Products[$i]['Preco'];
$datap[$i]['total'] = $Products[$i]['Total'];
$datap[$i]['tax'] = 0; //$Products[$i]['Tax'];
(int)$datap[$i]['reward'] = 0; //$Products[$i]['Reward'];
}
$url = $myurl;
$data['invoice_prefix'] = $this->config->get('config_invoice_prefix');
$data['store_id'] = $this->config->get('config_store_id');
$data['store_name'] = "Loja Teste";
$data['store_url'] = $url;
$data['firstname'] = $data2['firstname'] ;
$data['lastname'] = $data2['lastname'];
$data['email'] = $data2['email'];
$data['telephone'] = $data2['telephone'];
$data['fax'] = $data2['fax'];
$data['payment_firstname'] = $delivery['firstname'];
$data['payment_lastname'] = $delivery['lastname'];
$data['payment_company'] = $delivery['company'];
$data['payment_company_id'] = $delivery['company_id'];;
$data['tax_id'] = $delivery['tax_id'];
$data['payment_address_1'] = $delivery['address_1'];
$data['payment_address_2'] = $delivery['address_2'];
$data['payment_city'] = $delivery['city'];
$data['payment_postcode'] = $delivery['postcode'];
$data['payment_country'] = $delivery['country'];
$data['payment_country_id'] = $delivery['country_id'];
$data['payment_zone'] = $delivery['zone'];
$data['payment_zone_id'] = $delivery['zone_id'];
$data['payment_method'] = "Cash On Delivery";
$data['payment_code'] = 1;
$data['total'] = $TotalCheckout;
//NOTA: esta duas variaveis abaixo servem para tratar dos preços, alterar depois para quando a loja tiver opçoes de escolher preços
$data['language_id'] = (int)$this->config->get('config_language_id');
$data['accept_language'] = $this->request->server['HTTP_ACCEPT_LANGUAGE'];
$data['currency_id'] = (int)2;
$data['currency_code'] = "USD";
$data['currency_value'] = (float)1.00000000;
$data['ip'] = $IP;
$data['forwarded_ip'] = $IP;
$data['user_agent'] = $Agent;
$data['products'] = $datap;
(int)$order = $this->model_checkout_order->addOrder($data);
$this->model_checkout_order->confirm($order, 1 , $comment = '', $notify = false);
echo ("teste");
}
}