mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Order Confirmation
This commit is contained in:
17
lib/shopify/fragments/address.ts
Normal file
17
lib/shopify/fragments/address.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
const addressFragment = /* GraphQL */ `
|
||||
fragment Address on CustomerAddress {
|
||||
id
|
||||
address1
|
||||
address2
|
||||
firstName
|
||||
lastName
|
||||
provinceCode: zoneCode
|
||||
city
|
||||
zip
|
||||
countryCodeV2: territoryCode
|
||||
company
|
||||
phone: phoneNumber
|
||||
}
|
||||
`;
|
||||
|
||||
export default addressFragment;
|
56
lib/shopify/fragments/order-metafields.ts
Normal file
56
lib/shopify/fragments/order-metafields.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
const orderMetafieldsFragment = /* GraphQL */ `
|
||||
fragment OrderMetafields on Order {
|
||||
warrantyStatus: metafield(namespace: "custom", key: "warranty_status") {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationDeadline: metafield(
|
||||
namespace: "custom"
|
||||
key: "warranty_activation_deadline"
|
||||
) {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationOdometer: metafield(
|
||||
namespace: "custom"
|
||||
key: "warranty_activation_odometer"
|
||||
) {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationInstallation: metafield(
|
||||
namespace: "custom"
|
||||
key: "warranty_activation_installation"
|
||||
) {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationSelfInstall: metafield(
|
||||
namespace: "custom"
|
||||
key: "warranty_activation_self_install"
|
||||
) {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationVIN: metafield(namespace: "custom", key: "warranty_activation_vin") {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationMileage: metafield(namespace: "custom", key: "warranty_activation_mileage") {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
orderConfirmation: metafield(namespace: "custom", key: "customer_confirmation") {
|
||||
value
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export default orderMetafieldsFragment;
|
38
lib/shopify/fragments/order-transaction.ts
Normal file
38
lib/shopify/fragments/order-transaction.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
const orderTransactionFragment = /* GraphQL */ `
|
||||
fragment OrderTransaction on OrderTransaction {
|
||||
id
|
||||
processedAt
|
||||
paymentIcon {
|
||||
id
|
||||
url
|
||||
altText
|
||||
}
|
||||
paymentDetails {
|
||||
... on CardPaymentDetails {
|
||||
last4
|
||||
cardBrand
|
||||
}
|
||||
}
|
||||
transactionAmount {
|
||||
presentmentMoney {
|
||||
...Price
|
||||
}
|
||||
}
|
||||
giftCardDetails {
|
||||
last4
|
||||
balance {
|
||||
...Price
|
||||
}
|
||||
}
|
||||
status
|
||||
kind
|
||||
transactionParentId
|
||||
type
|
||||
typeDetails {
|
||||
name
|
||||
message
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export default orderTransactionFragment;
|
@@ -1,4 +1,8 @@
|
||||
import addressFragment from './address';
|
||||
import lineItemFragment from './line-item';
|
||||
import orderMetafieldsFragment from './order-metafields';
|
||||
import orderTrasactionFragment from './order-transaction';
|
||||
import priceFragment from './price';
|
||||
|
||||
const orderCard = /* GraphQL */ `
|
||||
fragment OrderCard on Order {
|
||||
@@ -16,69 +20,44 @@ const orderCard = /* GraphQL */ `
|
||||
}
|
||||
}
|
||||
totalPrice {
|
||||
amount
|
||||
currencyCode
|
||||
...Price
|
||||
}
|
||||
subtotal {
|
||||
...Price
|
||||
}
|
||||
totalShipping {
|
||||
...Price
|
||||
}
|
||||
totalTax {
|
||||
...Price
|
||||
}
|
||||
shippingLine {
|
||||
title
|
||||
originalPrice {
|
||||
...Price
|
||||
}
|
||||
}
|
||||
lineItems(first: 20) {
|
||||
nodes {
|
||||
...LineItem
|
||||
}
|
||||
}
|
||||
shippingAddress {
|
||||
...Address
|
||||
}
|
||||
billingAddress {
|
||||
...Address
|
||||
}
|
||||
transactions {
|
||||
...OrderTransaction
|
||||
}
|
||||
...OrderMetafields
|
||||
}
|
||||
${lineItemFragment}
|
||||
`;
|
||||
|
||||
export const orderMetafields = /* GraphQL */ `
|
||||
fragment OrderMetafield on Order {
|
||||
id
|
||||
warrantyStatus: metafield(namespace: "custom", key: "warranty_status") {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationDeadline: metafield(
|
||||
namespace: "custom"
|
||||
key: "warranty_activation_deadline"
|
||||
) {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationOdometer: metafield(
|
||||
namespace: "custom"
|
||||
key: "warranty_activation_odometer"
|
||||
) {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationInstallation: metafield(
|
||||
namespace: "custom"
|
||||
key: "warranty_activation_installation"
|
||||
) {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationSelfInstall: metafield(
|
||||
namespace: "custom"
|
||||
key: "warranty_activation_self_install"
|
||||
) {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationVIN: metafield(namespace: "custom", key: "warranty_activation_vin") {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
warrantyActivationMileage: metafield(namespace: "custom", key: "warranty_activation_mileage") {
|
||||
value
|
||||
id
|
||||
key
|
||||
}
|
||||
}
|
||||
${addressFragment}
|
||||
${priceFragment}
|
||||
${orderTrasactionFragment}
|
||||
${orderMetafieldsFragment}
|
||||
`;
|
||||
|
||||
export default orderCard;
|
||||
|
8
lib/shopify/fragments/price.ts
Normal file
8
lib/shopify/fragments/price.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
const priceFragment = /* GraphQL */ `
|
||||
fragment Price on MoneyV2 {
|
||||
amount
|
||||
currencyCode
|
||||
}
|
||||
`;
|
||||
|
||||
export default priceFragment;
|
Reference in New Issue
Block a user