Magento SOAP API v2将电子邮件设置为帐单邮寄地址

时间:2012-08-23 09:25:13

标签: api magento soap

我正在使用Magento

将我的应用与SOAP API v2集成

我需要将电子邮件设置为帐单邮寄地址。目前,可以通过shoppingCartInfo API调用查看结算地址电子邮件(请参阅shoppingCartAddressEntity字段说明),但似乎无法通过{设置它{3}} API调用(shoppingCartCustomerAddressEntity中没有此类字段。)

有没有办法实现这个目标?

1 个答案:

答案 0 :(得分:1)

尝试创建自定义客户地址属性

您可以通过此link1link2

了解相关信息

之后你可以

$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,
    )
);