我正在使用Magento
将我的应用与SOAP API v2集成我需要将电子邮件设置为帐单邮寄地址。目前,可以通过shoppingCartInfo
API调用查看结算地址电子邮件(请参阅shoppingCartAddressEntity
字段说明),但似乎无法通过{设置它{3}} API调用(shoppingCartCustomerAddressEntity
中没有此类字段。)
有没有办法实现这个目标?
答案 0 :(得分:1)
尝试创建自定义客户地址属性
了解相关信息之后你可以
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');
$shoppingCartId = $proxy->call( $sessionId, 'cart.create', array( 'magento_store' ) );
$arrAddresses = array(
array(
"mode" => "shipping",
"firstname" => "testFirstname",
"lastname" => "testLastname",
"email" => "testEmail", // this is your custom attribute (email) on address.
"company" => "testCompany",
"street" => "testStreet",
"city" => "testCity",
"region" => "testRegion",
"postcode" => "testPostcode",
"country_id" => "id",
"telephone" => "0123456789",
"fax" => "0123456789",
"is_default_shipping" => 0,
"is_default_billing" => 0
),
array(
"mode" => "billing",
"address_id" => "customer_address_id"
)
);
$resultCustomerAddresses = $proxy->shoppingCartCustomerAddresses(
$sessionId,
array(
$shoppingCartId,
$arrAddresses,
)
);