Removing add to cart button from Warehouse theme liquid code

Hello Everyone!

I am in the middle of creating a new product template within the WAREHOUSE theme using this shopify tutorial

https://shopify.dev/tutorials/customize-theme-replace-add-to-cart-button?shpxid=8589b35c-89E8-4DAF-4834-65CFEEF176D5

I managed to create a new template, named it “product-template-no-cart-button”. And created a new product section titled “product-template-no-cart-button”.

I’ve copied the liquid code from the original section titled “product-template.liquid” into my new section…

Now.. to HIDE the add to cart button, the tutorial says to "find the html code for “product form” within my newly created section. I’ve hunted all over and cannot find that.

Once I DO find it.. I plan to comment the heck out of that button by encapsulating the code between “{% comment %}” and “{% endcomment %}”

But FIRST… I gotta FIND that button code.

Any advice? Suggestions?

Thank you in advance. I appreciate your help.

I figured it might help to post the liquid code for that product section… so here it is..

{%- capture section_settings -%}
{
“showShippingEstimator”: {% if template == ‘product.quick-view’ or product.available == false %}false{% else %}{{ section.settings.show_shipping_estimator | json }}{% endif %},
“showQuantitySelector”: {{ section.settings.show_quantity_selector | json }},
“showPaymentButton”: {{ section.settings.show_payment_button | json }},
“showInventoryQuantity”: {% if product.template_suffix != ‘pre-order’ %}{{ section.settings.show_inventory_quantity | json }}{% else %}false{% endif %},
“lowInventoryThreshold”: {{ section.settings.low_inventory_threshold | json }},
“galleryTransitionEffect”: {{ section.settings.carousel_effect | json }},
“enableImageZoom”: {% if template == ‘product.quick-view’ %}false{% else %}{{ section.settings.enable_image_zoom | json }}{% endif %},
“zoomEffect”: {{ section.settings.zoom_effect | json }},
“enableVideoLooping”: {{ section.settings.enable_video_looping | json }},
“productOptions”: {{ product.options | json | escape }},
“enableHistoryState”: {% if template == ‘product.quick-view’ %}false{% else %}true{% endif %},
“infoOverflowScroll”: {% if template == ‘product.quick-view’ %}false{% else %}true{% endif %},
“isQuickView”: {% if template == ‘product.quick-view’ %}true{% else %}false{% endif %}
}
{%- endcapture -%}

{%- if template != 'product.quick-view' -%}
  1. {{ 'general.breadcrumb.home' | t }} {%- render 'icon', icon: 'arrow-right' -%}
  2. {%- if collection -%} {{ collection.title }} {%- render 'icon', icon: 'arrow-right' -%} {%- else -%} {{- 'collection.general.all_products' | t -}} {%- render 'icon', icon: 'arrow-right' -%} {%- endif -%}
  3. {{ product.title | truncate: 40 }}

{%- if collection.previous_product or collection.next_product -%}

{%- endif -%}
{%- if product.media.size > 0 -%}
{% render 'product-gallery' %}
{%- endif -%}
{% render 'product-info' %}

{%- if product.description != blank -%}

{%- if section.settings.content_display_mode == 'collapse_all' -%} {{ 'product.general.description' | t }}
{{ product.description | remove: 'data-section-type="product"' }}
{%- else -%}

{{ 'product.general.description' | t }}

{%- if section.settings.content_display_mode == ‘show_all_and_expand_description’ -%}

{{ product.description | remove: 'data-section-type="product"' }}
{%- else -%}
{{ product.description | remove: 'data-section-type="product"' }}
{{- 'product.general.view_more' | t -}}
{%- endif -%} {%- endif -%}

{%- if product.metafields.specification != blank -%}

Specifications

{% for field in product.metafields.specification %} {% endfor %} {%- if product.metafields.specification_sheets != blank -%} {%- endif -%}
{{ field | first }} {{ field | last }}
Specification Sheet {{ product.metafields.specification_sheets.pdf_name }}
{{ product.metafields.specification_sheets.pdf_name }}
{%- if product.metafields.specification_sheets.pdf_description != blank -%}

{{ product.metafields.specification_sheets.pdf_description }}

{%- endif -%}
{%- endif -%}
{%- endif -%}

{%- comment -%}

TABS

{%- endcomment -%}

{%- for i in (1..5) -%}
{%- assign unique_tab_title = ‘’ -%}
{%- assign unique_tab_content = ‘’ -%}

{%- comment -%}First check for metafields{%- endcomment -%}

{%- assign metafield_tab_title_option = ‘tab_’ | append: i | append: ‘title’ -%}
{%- assign metafield_tab_content_option = 'tab
’ | append: i | append: ‘_content’ -%}

{%- if product.metafields.sf_product_tabs[metafield_tab_title_option] != blank and product.metafields.sf_product_tabs[metafield_tab_content_option] != blank -%}
{%- assign unique_tab_title = product.metafields.sf_product_tabs[metafield_tab_title_option] -%}
{%- assign unique_tab_content = product.metafields.sf_product_tabs[metafield_tab_content_option] -%}
{%- else -%}
{%- assign tab_to_look = ‘__tab’ | append: i | append: ‘:’ -%}

{%- for tag in product.tags -%}
{%- if tag contains tab_to_look -%}
{%- assign unique_tab_handle = tag | split: tab_to_look | last -%}
{%- assign unique_tab_page = pages[unique_tab_handle] -%}

{%- unless unique_tab_page.empty? -%}
{%- assign unique_tab_title = unique_tab_page.title -%}
{%- assign unique_tab_content = unique_tab_page.content -%}
{%- break -%}
{%- endunless -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}

{%- if unique_tab_title != blank and unique_tab_content != blank -%}

{%- if section.settings.content_display_mode == 'collapse_all_except_description' or section.settings.content_display_mode == 'collapse_all' -%} {{ unique_tab_title }}
{{ unique_tab_content }}
{%- else -%}

{{ unique_tab_title }}

{{ unique_tab_content }}
{{- 'product.general.view_more' | t -}}
{%- endif -%}
{%- endif -%} {%- endfor -%}

{%- for i in (1..3) -%}
{%- assign global_tab_option = ‘tab_page_’ | append: i | append: ‘_handle’ -%}
{%- assign global_tab_page = pages[section.settings[global_tab_option]] -%}

{%- unless global_tab_page.empty? -%}

{%- if section.settings.content_display_mode == 'collapse_all_except_description' or section.settings.content_display_mode == 'collapse_all' -%} {{ global_tab_page.title }}
{{ global_tab_page.content }}
{%- else -%}

{{ global_tab_page.title }}

{{ global_tab_page.content }}
{{- 'product.general.view_more' | t -}}
{%- endif -%}
{%- endunless -%} {%- endfor -%}

{%- comment -%}

REVIEWS

{%- endcomment -%}

{%- if section.settings.enable_reviews -%}

{%- assign reviews_count = product.metafields.spr.reviews | split: '' | first | times: 1 -%}
{{ product.metafields.spr.reviews }}
{%- endif -%}

{%- comment -%}

SECURITY BADGES

{%- endcomment -%}

{%- if section.settings.show_payment_icons and shop.enabled_payment_types.size > 0 -%}
{%- assign show_payment_icons = true -%}
{%- else -%}
{%- assign show_payment_icons = false -%}
{%- endif -%}

{%- if section.settings.custom_security_badge or show_payment_icons -%}

{{ section.settings.trust_title | escape }}

{%- render ‘icon’, icon: ‘lock’, width: 22, height: 24 -%}

{%- if show_payment_icons -%} {%- if section.settings.custom_security_badge -%}

{{ 'product.general.payment' | t }}

{%- endif -%}
{% for type in shop.enabled_payment_types %} {{ type | payment_type_svg_tag: class: 'payment-list__item' }} {% endfor %}

{{ 'product.general.payment_notice' | t }}

{%- endif -%}

{%- if show_payment_icons and section.settings.custom_security_badge -%}


{%- endif -%}

{%- if section.settings.custom_security_badge -%}
{%- if show_payment_icons -%}

{{ 'product.general.security' | t }}

{%- endif -%}

{%- assign badge_width = section.settings.custom_security_badge.width | at_most: 450 | append: ‘x’ -%}
{{ section.settings.custom_security_badge.alt | escape }}
{%- endif -%}

{%- endif -%}

{%- comment -%}

ESTIMATE SHIPPING

{%- endcomment -%}

{%- if section.settings.show_shipping_estimator and product.available -%}

{{ 'product.general.estimate_shipping' | t }}

{{ 'cart.shipping_estimator.country' | t }}
{%- render 'icon', icon: 'arrow-bottom' -%}
{{ 'cart.shipping_estimator.province' | t }}
{%- render 'icon', icon: 'arrow-bottom' -%}

{{ 'cart.shipping_estimator.zip_code' | t }}

{{ ‘cart.shipping_estimator.estimate’ | t }}

{%- if section.settings.show_refunds_policy and shop.refund_policy != blank -%}

{{ 'product.general.refund_policy' | t }} {%- render 'icon', icon: 'arrow-right' -%}
{%- endif -%}
{%- endif -%}

{%- if section.settings.show_refunds_policy and shop.refund_policy != blank -%}

{{ 'product.general.refund_policy' | t }}

{%- render 'icon', icon: 'close' -%}
{{ shop.refund_policy }}
{%- endif -%} {%- else -%} {%- comment -%}We display the quick view within the product template so we can re-use the same settings{%- endcomment -%}
{%- render 'product-gallery' -%} {%- render 'product-info' -%}
{%- endif -%}

{% schema %}
{
“name”: “Product page”,
“settings”: [
{
“type”: “checkbox”,
“id”: “show_vendor”,
“label”: “Show vendor”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_sku”,
“label”: “Show SKU”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_share_buttons”,
“label”: “Show share buttons”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_taxes_included”,
“label”: “Show price taxes notice”,
“default”: false
},
{
“type”: “select”,
“id”: “selector_mode”,
“label”: “Selector type”,
“options”: [
{
“value”: “block”,
“label”: “Block”
},
{
“value”: “dropdown”,
“label”: “Dropdown”
}
],
“default”: “block”
},
{
“type”: “select”,
“id”: “color_mode”,
“label”: “Color selector type”,
“info”: “Variant image mode requires that all variant has an associated image. Learn more”,
“options”: [
{
“value”: “block”,
“label”: “Block”
},
{
“value”: “dropdown”,
“label”: “Dropdown”
},
{
“value”: “color”,
“label”: “Color swatch”
},
{
“value”: “variant_image”,
“label”: “Variant image”
}
],
“default”: “color”
},
{
“type”: “checkbox”,
“id”: “show_quantity_selector”,
“label”: “Show quantity selector”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_payment_button”,
“label”: “Show dynamic checkout button”,
“info”: “Each customer will see their preferred payment method from those available on your store, such as PayPal or Apple Pay. Learn more”,
“default”: true
},
{
“type”: “header”,
“content”: “Media”
},
{
“type”: “paragraph”,
“content”: “Learn more about media types
},
{
“type”: “select”,
“id”: “image_size”,
“label”: “Size”,
“info”: “Only applicable on desktop screens”,
“options”: [
{
“value”: “small”,
“label”: “Small”
},
{
“value”: “medium”,
“label”: “Medium”
},
{
“value”: “large”,
“label”: “Large”
}
],
“default”: “small”
},
{
“type”: “checkbox”,
“id”: “enable_image_zoom”,
“label”: “Enable image zoom”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “enable_video_looping”,
“label”: “Enable video looping”,
“default”: false
},
{
“type”: “select”,
“id”: “zoom_effect”,
“label”: “Zoom effect”,
“options”: [
{
“value”: “inside”,
“label”: “Inside”
},
{
“value”: “outside”,
“label”: “Outside”
}
],
“default”: “outside”
},
{
“type”: “select”,
“id”: “carousel_effect”,
“label”: “Transition effect”,
“options”: [
{
“value”: “fade”,
“label”: “Fade”
},
{
“value”: “slide”,
“label”: “Slide”
}
],
“default”: “fade”
},
{
“type”: “header”,
“content”: “Inventory”
},
{
“type”: “paragraph”,
“content”: “You can also add a stock countdown. Learn more.”
},
{
“type”: “checkbox”,
“id”: “show_inventory_quantity”,
“label”: “Show inventory quantity”,
“default”: false
},
{
“type”: “range”,
“id”: “low_inventory_threshold”,
“label”: “Low inventory threshold”,
“info”: “Use low stock color when quantity is below the threshold. Choose 0 to always show in stock.”,
“min”: 0,
“max”: 100,
“step”: 1,
“default”: 0
},
{
“type”: “header”,
“content”: “Content”
},
{
“type”: “paragraph”,
“content”: “You can also add per-product tabs. Learn more.”
},
{
“type”: “select”,
“id”: “content_display_mode”,
“label”: “Display mode”,
“options”: [
{
“value”: “show_all”,
“label”: “Show all”
},
{
“value”: “show_all_and_expand_description”,
“label”: “Show all and expand description”
},
{
“value”: “collapse_all”,
“label”: “Collapse all”
},
{
“value”: “collapse_all_except_description”,
“label”: “Collapse all except description”
}
],
“default”: “show_all_and_expand_description”
},
{
“type”: “page”,
“id”: “tab_page_1_handle”,
“label”: “First page”
},
{
“type”: “page”,
“id”: “tab_page_2_handle”,
“label”: “Second page”
},
{
“type”: “page”,
“id”: “tab_page_3_handle”,
“label”: “Third page”
},
{
“type”: “header”,
“content”: “Reviews”
},
{
“type”: “paragraph”,
“content”: “You need to install Shopify’s free Product Reviews app before enabling those options.”
},
{
“type”: “checkbox”,
“id”: “enable_reviews”,
“label”: “Enable”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_reviews_badge”,
“label”: “Show badge”,
“default”: false
},
{
“type”: “header”,
“content”: “Trust”
},
{
“type”: “text”,
“id”: “trust_title”,
“label”: “Heading”,
“default”: “Payment & Security”
},
{
“type”: “checkbox”,
“id”: “show_payment_icons”,
“label”: “Show payment icons”,
“default”: true
},
{
“type”: “image_picker”,
“id”: “custom_security_badge”,
“label”: “Security badge”,
“info”: “800 x 200px .jpg recommended”
},
{
“type”: “header”,
“content”: “Shipping estimator”
},
{
“type”: “checkbox”,
“id”: “show_shipping_estimator”,
“label”: “Show shipping estimator”,
“info”: “Only show if product is available.”,
“default”: true
},
{
“type”: “text”,
“id”: “shipping_estimator_default_country”,
“label”: “Default country”,
“info”: “If the customer is logged in, the country of their shipping address will be used.”,
“default”: “United States”
},
{
“type”: “checkbox”,
“id”: “show_refunds_policy”,
“label”: “Show refunds policy”,
“info”: “Refund policy must be added into your store policies. Learn more.”,
“default”: true
}
]
}
{% endschema %}

You can find that form in snippet/product-info.liquid

Thank you for you help Quyen-Beo.

I looked around in snippet/product-info.liquid for “form” as per the tutorial directions. And found what I believe to be the code.

So I created a new snippet titled “product-info-no-cart-button”. And copied and pasted the code from the “product-info” snippet. THEN, I went back into the section I had created “product-template-no-cart-button”, and searched for “product-info”. Replacing this…

{% render 'product-info' %}

with this…

{% render 'product-info-no-cart-button' %}

So, now I can make the changes I want to the “product-info-no-cart-button” snippet without fear of messing with the default button set up.

Right?.. eeep.. RIGHT!.

After a little hunting around in the new snippet I had created.. (I looked for anything to do with “button”) I found the code!.

here’s the code I commented out. Remember, this code is found in the newly created snippet “product-info-no-cart-button”

{% comment %}

{%- if product.template_suffix != 'contact' -%} {%- if selected_variant.available -%} {%- if product.template_suffix == 'pre-order' -%} {{ 'product.form.pre_order' | t }} {%- else -%} {{ 'product.form.add_to_cart' | t }} {%- endif -%} {%- else -%} {{ 'product.form.sold_out' | t }} {%- endif -%}

{%- if section.settings.show_payment_button -%}
{{ form | payment_button }}
{%- endif -%}
{%- else -%}
{{ ‘product.form.contact_us’ | t }}
{%- endif -%}

{% endcomment %}

So it WORKS! What I’ve learned is that if you are working in a sectional theme like Warehouse. And you want to create a new product template WITHOUT the “Add to cart” button, you will have to create a new product TEMPLATE, SECTION, and SNIPPET. And you will have to link them one to another.. from template to section to snippet.

Ohh.. I also commented out the product Quantity counter. And added a “NOT AVAILABLE ONLINE” bit of text with contact link.

Here is an example on our site.

https://aaronpackaging.com/collections/food-cans/products/603-x-700-gold-enamel-metal-food-cans-10

-David