AutomaticDiscountNode issues with Customer Buys and Customer gets

AutomaticDiscountNode issues with Customer Buys and Customer gets

NickMason
Shopify Partner
2 0 0

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? 

Reply 1 (1)

topshop
Shopify Partner
69 5 9

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?

 

topshop_0-1720118174551.png

 

Discount Bot: Sitewide Sales - How to Exclude Products from Shopify Discounts: A Step-by-Step Guide
- Instantly create discounts for your entire product catalog with a single discount
- Exclude any products / collections / already on sale items for which the discounts should NOT apply
- Built using Shopify Functions for native performance and feel