Discussing APIs and development related to customers, discounts, and order management.
So i am using this GraphQl query to test some automatic discounts
query automaticDiscountNode($id: ID!) {
automaticDiscountNode(id: $id) {
...on DiscountAutomaticNode {
id
}
automaticDiscount {
...on DiscountAutomaticBxgy {
customerBuys {
items {
... on DiscountProducts {
products(first: 1) {
edges {
node {
id
title
}
}
}
}
}
}
customerGets {
items {
...on DiscountProducts {
products(first: 1) {
edges {
node {
id
}
}
}
}
}
}
}
}
}
}
Some of my discounts will list the customer buys and customer gets objects with their id, titles, etc. However some will not. I have compared discounts and cant see a discernible difference. Both contain these fields with products selected, both are automatic discounts, all products are active not drafts etc. I can not figure out why this is happening. Help?
Automatic Discounts can be one of 4 types. Only type "Buy X get Y" will have customerGets. For example, "Amount off products" will not have that. Is that what you're facing?