Hello everyone!
I’m currently developing an app to handle complex discounts for shop owners.
My lack of knowledge is Liquid.
Is there a way to display API created Shopify Discount Codes into a theme page?
For example, I would like to create Discounts Codes via API and allocate it to a certain customer. Can I display certain discounts into customer profile page?
Is Liquid capable of doing this?
Thank you!
Have a great day!
Hi @dragos1195 ,
We would suggest that while creating discount code via API and assigning it to certain customer, you can add the customer tag with the name of discount. You can then display the discount code in customer profile page using below code.
{% for tag in customer.tags %}
{{tag}}
{% endfor %}
Thanks,
SynapseIndia® - Shopify (2.0 and Plus) Experts
https://shopify.synapseindia.com
I.T. Outsourcing [email removed] Peace of Mind
Thank you for your response!
I’ve taken this into consideration.
This way when the user orders products and it uses the discount code I would have to check the “discount_codes” object (from Order Webhook) against the customer tags and therefore clean up the tags section on that customer (separate call to Shopify Admin API).
I thought that there’s a way that the Discount Codes could be displayed via Liquid Objects so that customer assigned discounts information wouldn’t be saved again on some other entity (tags or metafields).
Thanks.
Still my question is that if there is a way to access Discount Codes via Liquid directly.
Thank you!
@Lkawer do you know the way?