2012-01-14 120 views
0

在Magento中,客戶可以將一個UPS賬戶號碼與其賬戶相關聯,從而允許他們使用其個人UPS賬戶號碼發貨並支付其貨件。在Magento API中檢索客戶的UPS賬戶號碼

我需要通過Magento API(V2)在訂單或客戶基礎上檢索。有誰知道,如果這是可以通過V2 API拉動的數據?我試圖避免直接點擊Magento數據庫。

由於

回答

1

該信息是在一個系統配置(Mage::getStoreConfig())。我不認爲API可以讓你訪問系統配置,你將不得不讓他們使用代碼:

$userid  = Mage::getStoreConfig('carriers/ups/username'); 
$userid_pass = Mage::getStoreConfig('carriers/ups/password'); 
$access_key = Mage::getStoreConfig('carriers/ups/access_license_number'); 

祝你好運。

編輯基於評論:

所以,如果你有客戶對象($customer = Mage::getModel('customer/customer')->load($customerId);你可以做$customer->getShippingAccount();(或任何屬性被稱爲)你不希望被查詢VARCHAR表。如果您正在通過客戶循環,你會做

Mage::getModel('customer/customer')->getCollection() 
    ->addAttributeToSelect('shipping_account') 
    ; 
+0

很抱歉的混亂,我的意思是個人客戶的運輸賬戶號碼。它存儲爲customer_entity_varchar表客戶屬性,尋找到它那之後還有,我不相信這是一個「開箱即用」的屬性,並且在一個點上添加了擴展或插件。在我們的系統中,此值的屬性ID爲1012. – dkpatt 2012-01-16 19:11:49

+0

請參閱根據您的評論進行編輯 – Max 2012-01-17 07:34:44