All things Shopify and commerce
I'm trying to get discounts filtering by product name. Is it possible or there any way out for it?
Hi, Can you elaborate a little more on the problem statement. I see that Discountnodes has a filter with a query where you can write something like below
from (https://shopify.dev/docs/api/admin-graphql/unstable/objects/DiscountNode)
Im trying to fetch discounts filtered based on product name
{
discountNodes(
first: 250
query=title:Full Sleeve T-shirt
) {
edges {
node {
id
discount {
... on DiscountCodeBasic {
title
status
combinesWith {
productDiscounts
orderDiscounts
shippingDiscounts
}
}
... on DiscountAutomaticBasic {
title
status
combinesWith {
productDiscounts
orderDiscounts
shippingDiscounts
}
}
... on DiscountAutomaticBxgy {
title
status
combinesWith {
productDiscounts
orderDiscounts
shippingDiscounts
}
}
... on DiscountCodeBxgy {
title
status
combinesWith {
productDiscounts
orderDiscounts
shippingDiscounts
}
}
... on DiscountCodeFreeShipping {
title
status
combinesWith {
productDiscounts
orderDiscounts
shippingDiscounts
}
}
... on DiscountAutomaticFreeShipping {
title
status
combinesWith {
productDiscounts
orderDiscounts
shippingDiscounts
}
}
}
}
}
}
}
Not possible. You can only filter discounts based on method and type, IIRC. You'll just have to filter them yourself in code.
Learn what's possible with customizing Shopify Checkout beyond what's available out of...
By Shopify Feb 19, 20252m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025