DEV Community

Dev-Sandbox
Dev-Sandbox

Posted on

1 1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay