How to use operator in Shopify Liquid to hide button with unique product ID

Viewed 135

I'm trying to hide the remove button from a product with certain id but kinda confuse, I have tried using {% if %} until it hits {% endif %} but still it doesn't want to hide it. For example I have tried to hide a button with class= "ajaxcart__qty-adjust ajaxcart__qty--delete icon-fallback-text" in product id 2423924.

 {{#items}}
    <div class="ajaxcart__product">
      <div class="ajaxcart__row" data-line="{{line}}">
        <div class="row">
          <div class="col-xs-4 col-md-3 col-img-left">
            <a href="{{url}}" class="ajaxcart__product-image"><img src="{{img}}" alt=""></a>
            
          </div>
          <div class="col-xs-8 col-md-9">
            <p>
              <a href="{{url}}" class="ajaxcart__product-name">{{name}}</a>
              {{#if variation}}
                <span class="ajaxcart__product-meta">{{variation}}</span>
              {{/if}}
              {{#properties}}
                {{#each this}}
                  {{#if this}}
                    <span class="ajaxcart__product-meta">{{@key}}: {{this}}</span>
                  {{/if}}
                {{/each}}
              {{/properties}}
              {% endraw %}{% if settings.cart_vendor_enable %}{% raw %}
                <span class="ajaxcart__product-meta">{{ vendor }}</span>
              {% endraw %}{% endif %}{% raw %}
              <button type="button" class="ajaxcart__qty-adjust ajaxcart__qty--detete icon-fallback-text" data-id="{{key}}" data-line="{{line}}" data-qty="0">
              <span class="fallback-text" aria-hidden="true">x</span>
              <span class="visually-hidden">{% endraw %}{{ 'cart.general.remove' | t }}{% raw %}</span>
            </button>
            </p>

            <div class="row display-table">
              <div class="col-xs-5 display-table-cell ">
                <div class="ajaxcart__qty">
                  <button type="button" class="ajaxcart__qty-adjust ajaxcart__qty--minus icon-fallback-text" data-id="{{key}}" data-qty="{{itemMinus}}" data-line="{{line}}">
       
                    <span class="fallback-text" aria-hidden="true">&minus;</span>
                    <span class="visually-hidden">{% endraw %}{{ 'cart.general.reduce_quantity' | t }}{% raw %}</span>
                  </button>
                  <input type="text" name="updates[]" class="ajaxcart__qty-num" value="{{itemQty}}" min="0" data-id="{{key}}" data-line="{{line}}" aria-label="quantity" pattern="[0-9]*">
                  <button type="button" class="ajaxcart__qty-adjust ajaxcart__qty--plus icon-fallback-text" data-id="{{key}}" data-line="{{line}}" data-qty="{{itemAdd}}">

                    <span class="fallback-text" aria-hidden="true">+</span>
                    <span class="visually-hidden">{% endraw %}{{ 'cart.general.increase_quantity' | t }}{% raw %}</span>
                  </button>
                  
                  
                  
                </div>
              </div>
              <div class="ajax_cart_money col-xs-7 display-table-cell text-left">
                {{#if discountsApplied}}
                  <small class="ajaxcart-item__price-strikethrough"><s>{{{originalLinePrice}}}</s></small>
                  <br><span>{{{linePrice}}}</span>
                {{else}}
                  <div>x <span class="money">{{{price}}}</span> = <span class="money money-total">{{{linePrice}}}</span></div>
                {{/if}}
                </div>
              </div>
              {{#if discountsApplied}}
                <div class="row display-table">
                  <div class="col-xs-12 text-right">
                    {{#each discounts}}
                      <small class="ajaxcart-item__discount">{{ this.title }}</small><br>
                    {{/each}}
                  </div>
                </div>
              {{/if}}
              </div>
            </div>
          </div>
        </div>
    {{/items}}
0 Answers
Related