Hello,
I'm curious, is there any way to access the "customer.orders_count" property inside the Scripts App? Or possibly a special customer group I have created? I would like to make some special customer discounts and not rely on the use of tags, if possible.
Thank you for any help.
Hi Kyle!
Currently, only the customer ID, email address, and tags are accessible through Scripts.
Are there any particular reasons why tags would not work for you?
Hi Alan,
Thank you, understood. I did read that in the docs, but hoped I missed something.
I was looking for a way to auto-discount the first customer order without applying a code in checkout. I could add a hidden tag at account creation and then remove the tag with a webhook after the first order - but I like the Scripts app because I dont have to host my own private app. If I had access to the "order_count" variable, I wouldn't need to rely on tags at all.
Going back to the promo code is probably best. Thx.
I was hoping to apply a discount to customers who agree to marketing but have not ordered before (so, i.e. a reward for signing up that does not require a coupon code) but that would require another Customer variable be exposed: accepts_marketing as well as orders_count
It would be super cool to be able to say “hey if you have never purchased with us before but register & sign up to our email list you will automagically get 20% off!"
I haven't gotten to sit down fully with scripts and it's late and i'm fuzzy, but couldn't these get passed through LIP's? if plaintext is a concern md5 filter them
Hey Rob!
With the PLUS plans, it would depend on your needs and requirement. You can learn more on the here on our Plus plans and reach out to the Plus team HERE for more details and information. :)
Thanks again for posting. :)
Dan | Shopify Guru
support@shopify.com
We've just recently added the orders_count and accepts_marketing? attributes to the Customer object. For further details, you can refer to the API documentation for the Customer object.
Hi,
Are there any issues with order count?
I have the following code which for some reason doesn't work. I have this code included in customers/login.liquid right after {%- form 'customer_login' -%} .
{%- if customer.orders_count != 0 -%} <input type="hidden" id="customer_tags" name="customer[tags]" value="existing"/> {% else %} <input type="hidden" id="customer_tags" name="customer[tags]" value=""/> {% endif %}
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |