We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Re: How can I add a certain line if customers are signed

How can I add a certain line if customers are signed

Jim_D
Tourist
6 0 2

I have a rewards program that i would love to show customers their points they are earning in the cart if they are signed in.  If they are not signed in show a different message.

 

If they have a account

<center><b>{% if customer %}{{ customer.first_name }}</b>
- So Far you are Earning <b>{{ cart.total_price }}</b> Points

{% endif %}</b></center>

 

If they are not signed in

<center><b> <a href="/pages/rewards">Sign-up</b></a> for FREE Rewards and Earn Points </center>

 

Also any clue how to convert the {{ cart.total_price }} to only dollars and not show cents

Replies 3 (3)

Mike-Consentik
Shopify Partner
196 30 39

Hi @Jim_D 

This is Mike from Omega

You can check this document: https://help.shopify.com/en/manual/payments/currency-formatting

Hope you find the solution for your issue

If you find this helpful, please give it a like or mark it as a solution.
Consentik GDPR Cookie Banner: Effortlessly stay in compliance with EU GDPR and CCPA with Google Consent Mode V2. Free plan available and 24/7 Support

slemey
Tourist
6 0 0

How can i do the same thing, for customers who have put items in there cart? So befoe the checkout, I want to show them, if they continue with there purchase they will earn xxx points.

For example: subtotal in the cart is 350 eur, and let's say 1 eur = 1 point.
Above the ''Checkout''-button'' I want to show the customer ''You will earn 350 points to spend on your next order''.

Of course, if customer changes QTY in cart, the points also change.

Can someone help me with this? I am using the Trade theme.

slemey
Tourist
6 0 0

I have found the solution myself.

In the Trade template go to main-cart-footer (sections)
add code below for eur or points calculations.

<div class="rewards-points-message" style="background:#fff2d7;">
{% assign points = cart.total_price | divided_by: 1000 %}
<p>U receive {{ points }} EUR discount on your next order</p>
</div>

Hope i could help someone else too.