DiscountNodes Filter by product name

DiscountNodes Filter by product name

Ritz
Shopify Partner
2 0 0

I'm trying to get discounts  filtering by product name. Is it possible or there any way out for it? 

Replies 3 (3)

gagarwal
Shopify Partner
43 0 6

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

Regards,
Gaurav,
co-founder, Kai Progress Bar App
Ritz
Shopify Partner
2 0 0

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
            }
          }
        }
      }
    }
  }
}

tobebuilds
Shopify Partner
528 39 141

Not possible. You can only filter discounts based on method and type, IIRC. You'll just have to filter them yourself in code.

Founder, Regios Discounts app (4.8 stars, 81 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer