Buyer info component
Learn how to use the Buyer Info component.
Use this drb2b_buyerInfo
component with the drb2b_taxCertificateCheckout
component. The drb2b_buyerInfo
publishes an event and the drb2b_taxCertificateCheckout
listens for the event triggered by the drb2b_buyerInfo
component. The drb2b_taxCertificateCheckout
is dependent on drb2b_buyerInfo
component.
If you use a custom component instead of the drb2b_buyerinfo
component, you must:
Populate the following fields in the
WebCart
object:digitalriverv3__Buyer_Name__c
digitalriverv3__Buyer_Email__c
digitalriverv3__Buyer_Phone__c
digitalriverv3__BillingAddress
digitalriverv3__DR_Customer_Type__c
Note: If you choose to use a custom component, make sure you validate that thedigitalriverv3__Buyer_Name__c
field contains a space. Digital River expects both a First Name and Last Name and does a split on this field by looking for a space, ' ' ,value.
Provide the selected ship-to contact point address ID to the OOTB flow which populates the ship-to address on the Cart Delivery Group object.
Publish an event from the custom component using LMS (Lightning Message Service) as
drb2b_taxCertificateCheckout
is dependent on this component.
Publish events
This section provides information on publishing events with using this component.
Publish an event to show/hide tax certificate button
Import the TaxCertificateMessageChannel__c
message channel and message service into a custom JavaScript file.
Declare the message context variable as shown below.
Declare the messageContext
variable as shown below.
To enable the drb2b_taxCertificateCheckout
component, set the showLink
value to true
when publishing the event.
Set the showLink
value to true
only when the shopper indicates that the purchase type
is business
and the country is the United States
. For digital purchases, check the country of the Billing Address. For physical and mixed cart purchases, check the country of the Shipping Address. In all other cases, set the showLink
value to false
. Send the event any time the shopper updates these values.
Publish other events
Use the following steps to publish various event types. The event purpose and payload will vary depending on your use case.
Import theDigitalRiverMessageChannel__c
message channel and message service into a custom JavaScript file as shown below.
Declare the message context variable as shown below.
Publish the event.
The following table provides more information on the component events.
Subscribe to event to get Contact Point Address Id
You can use this event to have the saved Contact Point Address Id returned back after the buyer information is saved using the saveBuyerInfo purpose. You use this value to update the Cart Delivery Group as appropriate. Complete the following tasks to subscribe to the event.
Import the DigitalRiverMessageChannel__c
message channel and message service into a custom JavaScript file as shown below.
Declare the message context variable as shown below.
Declare methods as shown below to get the Contact Point Address Id.
The following is an example of the message format:
Call a declared method in the connectedCallback method as shown below:
Last updated