Coding help

Highlighted
New Member
1 0 1

Hey Guys,

 

I need some coding help. Below is what I am trying to achieve:

We are a daily deals website, however recently started selling tickets to local event, we are using Evey App to manage the events. One of the event has a requirement of getting detail of all the attendees. This is currently being achieved by below code (as provided on Evey's website). However, this is not excluding other products and events in store.

Hence, I need to put a condition in below code where it will ask for additional information of the attendees only for the products that are tagged "UGA" and not other products in shopping cart.

<tr class="cart-attributes">
<td colspan="100">
{% for i in (1..item.quantity) %}
<div class="col-attributes-row">
<span class="attribute-row-num">{{ i }}.</span>
<div class="col-attributes-inputs">
<input type="text" name="attributes[attendee-{{ item.variant.id }}-{{ i }}-firstname]" placeholder="First Name" required style="display:inline-block;" />
<input type="text" name="attributes[attendee-{{ item.variant.id }}-{{ i }}-lastname]" placeholder="Last Name" required style="display:inline-block;" />
<input type="text" name="attributes[attendee-{{ item.variant.id }}-{{ i }}-email]" placeholder="Email" required style="display:inline-block;" />
</div>
</div>
{% endfor %}
</td>
</tr>

Please help


1 Like
Shopify Expert
2960 505 683

HI @ideals 

You can add product tag condition like bellow:

{% if product.tags  contains 'UGA' %}     
         //here if tag added
{% else %}
        //here if tag not added       
{% endif %}

Note: you can use on product page only if you are on separate page then need to manage by different condition. 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted

Hi @ideals 

A more comprehensive solution would include the for loop that is required in order to call the tag... please see below

{% for tag in product.tags %}
  {% if tag contains 'UGA' %}
    // occurs when tag contains UGA
  {% else %}
// occurs when tag DOES NOT contain UGA {% endif %}
{% endfor %}

Let me know if any issues with this

Brett

 

Was my answer helpful? Be sure to give it a "Like" and mark it as the solution - this way others can find it easily.
- Need help with a Shopify build or custom solution? Feel free to get in touch via hello@stonedigital.com.au !
- Did my reply help solve your problem? The above email is my Paypal too ʘ‿ʘ
0 Likes