Hello Shopify Community,
I have a metafield named “product_discount_percent” associated with my products, containing the discount percentage. Now, I am facing an issue where I need to apply this discount specifically to line items when a user is logged in and has a certain tag.
To elaborate further, I want to create a conditional scenario where if a user is logged in and has a particular tag, the discount percentage stored in the “product_discount_percent” metafield should be applied to the corresponding line item during checkout.
I have looked into the documentation and various forums but couldn’t find a clear solution for this specific use case.
I tried to achieve this using shopify product discount function but facing issue it always applying discount with multiple targets but single discount value.
https://shopify.dev/docs/api/functions/reference/product-discounts/graphql
Thank you in advance for your help!