Personalized checkout and custom promotions with Shopify Scripts
I'm trying to build a solution to prevent customers from checking out with an item if the item within checkout is a specific vendor and the discount code used is a specific code. I'm new to Shopify dev scene and am trying to learn myself. I am not sure if I should build a Shopify function or a Shopify Checkout UI extension. I tried to achieve this using Checkout UI extension and using GraphQL query to get the vendor data using useApi. My GraphQL query is:
query GetCheckoutData($checkoutId: ID!) { node(id: $checkoutId) { ... on Checkout { id lineItems { nodes { id variant { id product { id vendor } } } } } } }
but I don't get any return. I tried console logging this data and this is what I saw:
Object { message: "Internal error. Looks like something went wrong on our end.\nRequest ID: f30dcd81-3eb3-4b04-82e6-095f8df2577a-1709906907 (include this in support requests).", extensions: {…} }
I'm not sure what I'm doing wrong. Also, where I should request support. Thank you in advance for any help.
2m 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, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025