Solved

Showing TAGS on product card (VENTURE THEME)

SHIBdev
Shopify Partner
334 24 92

Hi there community, im having some troubleshooting with this..  i'll put some picture to explain what i mean, productcardedit.jpg

i want to show like this: 

Plata de Ley 925

Piedras Semipreciosas

 

in that order, here is the code i used:

    {% for tag in product.tags %}
           {%if tag contains "Plata" %}
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Plata de Ley 925</span>        
           </div>
           {% endif %}
           {%if tag contains "Baño de Oro 18K" %}
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Baño de Oro 18K / Plata de Ley 925</span>               
           </div>
           {% endif %}           
           {%if tag contains "Semipreciosas" %}   
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Piedras Semipreciosas</span>        
           </div>
           {% endif %}
         {% endfor %}

 

if something more it's needed, please tell me, in advance, thanks anyway!!

Accepted Solution (1)
ChoosiZon
Shopify Partner
416 66 111

This is an accepted solution.


@SHIBdev wrote:

@ChoosiZon i think we are not in the same way.. let's me explain what i mean.. 

if i choose "Plata de Ley 925" and "Piedras Semipreciosas",

the order should be :

- Plata de Ley 925

- Piedras Semipreciosas

 

At the moment it still showing the same order with your code, sir!

 


 

 

I got what you mean. The default tags output is in alphabetical order and can't be changed.

However we can try this. (not tested)

 

{% for tag in product.tags %}   
          {%if tag contains "Plata" %}
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Plata de Ley 925</span>        
           </div>
           {% endif %}
         {% endfor %}
{% for tag in product.tags %}
         {%if tag contains "Baño de Oro 18K" %}
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Baño de Oro 18K / Plata de Ley 925</span>               
           </div>
           {% endif %}    
{% endfor %}    
{% for tag in product.tags %}   
           {%if tag contains "Semipreciosas" %}   
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Piedras Semipreciosas</span>        
           </div>
           {% endif %}
{% endfor %}  

 

 

EDITED**

 

 

Donate
For faster response with a fee pls email to : choositech@outlook.com

View solution in original post

Replies 11 (11)

ChoosiZon
Shopify Partner
416 66 111

 

id="product-item-subtitle_page_card"

 

 

Your id is not unique.

May affect your SEO.

Donate
For faster response with a fee pls email to : choositech@outlook.com
SHIBdev
Shopify Partner
334 24 92

@ChoosiZon thanks for that ! anyway im making some edits so..! if you can help me with my problem.. 🙂

ChoosiZon
Shopify Partner
416 66 111

Pls show your url, without that difficult to troubleshoot and see your issue.

Donate
For faster response with a fee pls email to : choositech@outlook.com
SHIBdev
Shopify Partner
334 24 92
ChoosiZon
Shopify Partner
416 66 111

Everything seems to be working fine.

Would you like to use a snipping tool to show what you want?

Free Snipping Tool

Donate
For faster response with a fee pls email to : choositech@outlook.com
SHIBdev
Shopify Partner
334 24 92

@ChoosiZon , yes but i want to change order position,

Plata de Ley 925

Piedras Semipreciosas

Thanks anyway 

ChoosiZon
Shopify Partner
416 66 111

@SHIBdev wrote:

@ChoosiZon , yes but i want to change order position,

Plata de Ley 925

Piedras Semipreciosas

Thanks anyway 


{% for tag in product.tags %}
         {%if tag contains "Baño de Oro 18K" %}
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Baño de Oro 18K / Plata de Ley 925</span>               
           </div>
           {% endif %}           
           {%if tag contains "Semipreciosas" %}   
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Piedras Semipreciosas</span>        
           </div>
           {% endif %}
          {%if tag contains "Plata" %}
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Plata de Ley 925</span>        
           </div>
           {% endif %}
         {% endfor %}

 

 

This way the order will be :

Baño de Oro 18K / Plata de Ley 925

Piedras Semipreciosas

Plata de Ley 925

 

Donate
For faster response with a fee pls email to : choositech@outlook.com
SHIBdev
Shopify Partner
334 24 92

@ChoosiZon i think we are not in the same way.. let's me explain what i mean.. 

if i choose "Plata de Ley 925" and "Piedras Semipreciosas",

the order should be :

- Plata de Ley 925

- Piedras Semipreciosas

 

At the moment it still showing the same order with your code, sir!

 

ChoosiZon
Shopify Partner
416 66 111

This is an accepted solution.


@SHIBdev wrote:

@ChoosiZon i think we are not in the same way.. let's me explain what i mean.. 

if i choose "Plata de Ley 925" and "Piedras Semipreciosas",

the order should be :

- Plata de Ley 925

- Piedras Semipreciosas

 

At the moment it still showing the same order with your code, sir!

 


 

 

I got what you mean. The default tags output is in alphabetical order and can't be changed.

However we can try this. (not tested)

 

{% for tag in product.tags %}   
          {%if tag contains "Plata" %}
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Plata de Ley 925</span>        
           </div>
           {% endif %}
         {% endfor %}
{% for tag in product.tags %}
         {%if tag contains "Baño de Oro 18K" %}
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Baño de Oro 18K / Plata de Ley 925</span>               
           </div>
           {% endif %}    
{% endfor %}    
{% for tag in product.tags %}   
           {%if tag contains "Semipreciosas" %}   
             <div id="product-item-subtitle_page_card" class="product-item-subtitle">
              <span>Piedras Semipreciosas</span>        
           </div>
           {% endif %}
{% endfor %}  

 

 

EDITED**

 

 

Donate
For faster response with a fee pls email to : choositech@outlook.com
SHIBdev
Shopify Partner
334 24 92

@ChoosiZon yes i understand, anyway im playing with operators, and i think im on the way..  thanks a lot sir!

SHIBdev
Shopify Partner
334 24 92

** EDITED:  thanks @ChoosiZon your code works really well right now! i made some changes on products.collection, and that's it! thanks you!