Discount Product

omer_olmaz
New Member
10 0 0

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?

Replies 9 (9)
rmanke
Shopify Partner
162 0 44

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.

Shopify Partner, software developer and designer.
omer_olmaz
New Member
10 0 0

@ron

with which API can I do it? Could you show me the starting point? thanks. 

rmanke
Shopify Partner
162 0 44

Here is some sample code someone posted here, that will show product variants (with different prices) based on which group they are in:

https://ecommerce.shopify.com/c/ecommerce-design/t/how-to-show-product-variants-based-on-customer-ta...

 

 {% 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 %}

 

Shopify Partner, software developer and designer.
omer_olmaz
New Member
10 0 0

thanks @ron

I do not understand this code. Where does it belong? I am writing it with php.

rmanke
Shopify Partner
162 0 44

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.

Shopify Partner, software developer and designer.
omer_olmaz
New Member
10 0 0

Thank you @Ron

I need to report the discounted persons with soap api. Can I make this?

rmanke
Shopify Partner
162 0 44

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.  

Shopify Partner, software developer and designer.
omer_olmaz
New Member
10 0 0

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. 

rmanke
Shopify Partner
162 0 44

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.

 

Shopify Partner, software developer and designer.