【问题标题】:Magento SOAP API v2 Set email to billing addressMagento SOAP API v2 将电子邮件设置为帐单地址
【发布时间】:2012-08-23 09:25:13
【问题描述】:

我正在使用SOAP API v2 将我的应用程序与Magento 集成

我需要将电子邮件设置为帐单地址。目前可以通过shoppingCartInfo API 调用查看账单地址邮件(参见shoppingCartAddressEntity 字段说明),但似乎没有办法通过shoppingCartCustomerAddresses API 调用设置shoppingCartCustomerAddressEntity中没有这个字段)。

有什么办法可以做到吗?

【问题讨论】:

  • 如果你问“有办法”。是的,有办法。这个世界上没有什么不可能的事。但是实现起来很复杂。您必须自定义您的 Mage_Checkout_Model_Cart_Payment_Api 以将电子邮件设置为客户帐单地址。
  • @JosuaMarcelChrisano 所以只有一种方法 - 实现它?

标签: api magento soap


【解决方案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,
    )
);

【讨论】:

  • @hazzik woops,那么它不能更改或添加新属性。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-11
  • 1970-01-01
  • 1970-01-01
  • 2020-08-12
相关资源
最近更新 更多