Re: Hide price on collection page in Galleria with a Hide Tag

Hide price on collection page in Galleria with a Hide Tag

Mark-et-Zoé
Visitor
2 0 0

I finished customizing the theme Galleria and I already managed to get a product page template that hides the price and add to cart button to display a "call us" button instead, with a form to fill, thanks to a shopify expert.

 

All I needed to manage was to find a way to hide the price on collection pages as well. I thought the theme would display a customized sentence instead of the price if I put zero as price. Instead it just shows a plain 0,00€, which wouldn't be right. I tried to add a code in the snippet product.template.liquid :

{% if product.tags contains 'Hide' %}
<div class="ProductItem__PriceList Heading">
<ls-static-854490>Prix sur demande</ls-static-854490>
</div>

 

But it did not change a thing. If possible I want to add a "Hide" tag to some of my products : to hide the price and display a sentence like "Price on demand". I already managed that on another Shopify theme, but the code doesn't work on Galleria.

 

I know there are some apps that could help, but I don't want to subscribe to one of those since adding a code can do the trick for free.

 

Here is the code of the price part I think is related to my task in product-template.liquid

 

      <ul class="product-item-caption-price" {% if hide_price %} style="display:none" {% endif %}>             
                <li id="ComparePrice-{{ section.id }}" class="product-item-caption-price-list"><span class="money">
                  {% if current_variant.compare_at_price > current_variant.price %}
                  {{ current_variant.compare_at_price | money }}
                  {% endif %}
                  </span>
                </li> 
                <li id="ProductPrice-{{ section.id }}" class="product-item-caption-price-current"><span class="money">{{ current_variant.price | money }}</span></li>
              </ul>
                 <div class="price0_text" {% unless hide_price %} style="display:none" {% endunless %}>{{settings.custom_price0_text}}</div>
            </header>
          </div>
          {% if descriptionSecondPart != blank%}
          <div class="product-item-caption-desc description-first-part rte-page">
            {{ descriptionFirstPart }}
          </div>
          {% endif %}

Or may be it is a collection-template issue? 

Replies 3 (3)

VIEKIN
Shopify Partner
746 91 106

@Mark-et-Zoé 

Thing your want is hidden price in collection page, but you do it on product page template? 
If you want check if product have "Hide" tag, you  need check follow this way:

{% assign hide = false %}
{% for tag in product.tags %}

{% if tag contains "Hide" %}

{% assign hide = true %}

{% endif %}

{% endfor %}

And then you take the variable hide  go to place you want check, stay here you can check follow:
{% if hide == true %}

//Not show price

{% else %}

//Show price

{% endif %}

And you need implement the code in the product-item.liquid (this file usually stay in snippets) file or else a file follow your theme (im not sure file name in your theme) but the file will stay in the loop function in collection template.
If you can't implement, don't do not be shy you can contact with me, i can help.
Hope will helpful to you!

You can please Like and Accepted Solution if my suggestion helpful. And if you want to customize or develop new feature on Theme or App => Contact to us via Email or Skype.
- Contact Support : Gmail | Skype: live:.cid.309f2fbaceec513
Mark-et-Zoé
Visitor
2 0 0

Hello Phavia, sorry for the late reply.

 

I don't really understand where you suggest I put this code. I added it somewhere in my collection-template.liquid (section) and then tried on product-template.liquid (snippet). But the price is still showing on my collection pages. It seems Galleria doesn't have any product-item.liquid snippet.

 

Any other suggestions?

VIEKIN
Shopify Partner
746 91 106

@Mark-et-Zoé ,

a journey longtime for reply 😊

About that issue, sorry, because i don't familiar with your code theme doing handle, so i cannot giving to you the solution exactly, if i can access to code so i can check it,

 

You can please Like and Accepted Solution if my suggestion helpful. And if you want to customize or develop new feature on Theme or App => Contact to us via Email or Skype.
- Contact Support : Gmail | Skype: live:.cid.309f2fbaceec513