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.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024