2013-04-22 42 views
0

我在使用聯接工作時遇到問題。我試圖將訂單ID連接到客戶電話號碼,並保存在sales_flat_order_address中。因此,加入sales/order的收藏以及基於變量的過濾器,其中包含我的電話號碼。我嘗試了各種組合,但到目前爲止,我只能得到錯誤,現在我已經刪除了我的代碼,並將從頭開始嘗試。任何想法或指向這個教程的鏈接?從客戶數據中獲取magento訂單ID

回答

0

一小段代碼如下

$customer = Mage::getModel('customer/customer')->getCollection() 
->addAttributeToFilter('attribute_code', value)->load(); 
//Here your attribute code is phone 
$orderCollection = Mage::getModel(’sales/order’)->getCollection(); 
$orderCollection->getSelect()->where(’e.customer_id =’.$customer->getId()); 

:)

+0

謝謝,但'客戶/ customer'似乎不包括記帳信息或運輸信息,如電話或地址。我會研究一下,看看我能否以某種方式得到它。 – 2013-04-22 11:21:25

+0

在這種情況下使用客戶/地址 – Sandeep 2013-04-22 12:51:07