Development discussions around Shopify APIs
I will add a code to the user like flag. and when I shop with this code I want to show the product discount. then it will buy at a discount. How can I make this app? is it possible?
You can add tags to your customers and then check for that tag as they browse pages to display discounts.
There are many ways to implement this.
@ron
with which API can I do it? Could you show me the starting point? thanks.
Here is some sample code someone posted here, that will show product variants (with different prices) based on which group they are in:
{% unless customer.tags contains 'wholesale' %}
{% for variant in product.variants %}
{% if variant.sku contains 'wh' %}
jQuery('.single-option-selector option').filter(function() { return jQuery(this).html() === {{ variant.title | json }}; }).remove();
{% endif %}
{% endfor %}
jQuery('.single-option-selector').trigger('change');
{% endunless %}
thanks @ron
I do not understand this code. Where does it belong? I am writing it with php.
Hi,
This is written in Javascript, JQuery, and Liquid (Shopify's native coding standard). You won't need PHP for this.
You can customize almost all of shopify using Liquid templates. Here's an overview:
https://www.shopify.com/partners/blog/topics/learning-liquid
I am not exactly sure what your end goal is, so it is difficult to prescribe an approach. Based on your initial description, you probably only need to customize some liquid calls and use the in-page Javascript to do it.
Thank you @Ron
I need to report the discounted persons with soap api. Can I make this?
Yes you can, but you will have to build that yourself.
Or, you can do what I do and store the data in a google sheet using the google apps API.
Thanks @Ron But the problem continues.
I'm looking for a middle layer. How can I connect middle layer? so that I would like to apply discounts on the api in the application. this person will be marked during login. then you will buy it at the discounted price in the basket. I did not know how to do it.
Oh I see. This could be a complicated issue. How would you know to mark the user when they login?
You may have to talk to someone at Shopify for some strategies.
You will definitely need to set up business rules on how to identify who gets what discount, and then apply it to the cart when they check out. Shopify also has a way to add a discount when a user lands on the page, and there are many options in this area.
I would suggest contacting Shopify because it might be difficult outlining a workflow solution in a forum such as this.
User | RANK |
---|---|
5 | |
5 | |
5 | |
4 | |
4 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022