1. コマースの基礎

更新パーティー

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

サービスメソッドを使用するための開発者タスクUpdateParties.

UpdatePartiesは、既存のカートの関係者情報を更新するために使用されます。

Visual Studioソリューションのセットアップで、次の操作を行います。

  1. Sitecore.Commerce.Connect.CommerceServerとSitecore.Commerce.dllを参照します。

  2. このサービス メソッドを使用するソリューション内のクラスを選択します。

  3. 次のコードを貼り付けて、サービスメソッドを使用します。

    var  customerService =  new  CustomerServiceProvider();
    
    // create a customer
    var  customer = customerService.CreateCustomer( new  CreateCustomerRequest(
         new  CommerceCustomer
        {        
        Name =  "Jeff" ,
        Shops =  new [] {  "autohaus"  },
        ExternalId =  "1234567890"
        })).CommerceCustomer;
    
    var  parties =  new List <Party>
    {     
    new  Party {ExternalId =  "1234567890" , Address1 =  "123 My Street" , City =  "My City" , Country =  "My Country" , PartyId =  "1" }
    };
    // add the party
    var  addRequest =  new  AddPartiesRequest(customer, parties);
    var  addResult = customerService.AddParties(addRequest); 
    
    parties.Add( new  Party { ExternalId =  "9876543210" , Address1 =  "123 My Road" , City =  "My Town" , Country =  "Your Country" , PartyId =  "2"  });
    // update the parties
    var  updateRequest =  new  UpdatePartiesRequest(customer, parties);
    var  getResult = customerService.UpdateParties(updateRequest);
この記事を改善するための提案がある場合は、 お知らせください!