DEV Community

Dev-Sandbox
Dev-Sandbox

Posted on

Analytics/ Tracking

Scenario Needed: Get Order, Customer Details on Order Confirmation Page

We don't have separated firstname and lastname in stencil.

Solution
If customerId: 0
Get the customer details from Billing address
2 scenarios
- Already customer present, he chose to have the first name.
- New customer, we only have his info via the Billing address. So we will get this from Billing Address.

If Customer is logged in - Get via Graphql.

query Customer {
  customer {
    firstName
    lastName
    email
    entityId
  }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)