Hello,
I am trying to show the product type on collections and our homepage between the product title and the vendor. I also want it to be in h3. I am using the venue theme and my site is visible at thosewhobloom.com.
Thanks!
Hello,
I am trying to show the product type on collections and our homepage between the product title and the vendor. I also want it to be in h3. I am using the venue theme and my site is visible at thosewhobloom.com.
Thanks!
Which theme you are working on ?
Hi @thosewhobloom ,
Please go to Actions > Edit code > Find âproductâ. Then send me screenshots of file names in snippets, I will help you check and find the correct file to add code.
Venue
Venue
Hi @thosewhobloom ,
No, Venue is the theme name, Iâm referring to the product item display file name.
Refer
Then Iâll help you find the exact file and add the code for it.
Hi @thosewhobloom ,
Please send me the code of product-grid-item.liquid file, I will check and add it for you
{% if settings.product_grid_label %}
{% assign custom_label = false %}
{% for collection in product.collections %}
{% if collection.title == collections[settings.product_grid_label_collection].title %}
{% assign custom_label = true %}
{% endif %}
{% endfor %}
{% assign new_label = false %}
{% assign product_created_at = product.created_at | date: â%sâ %}
{% assign time_ago = ânowâ | date: â%sâ | minus: product_created_at | divided_by: 86400 %}
{% if time_ago < settings.product_grid_label_new_days %}
{% assign new_label = true %}
{% endif %}
{% if product.available == false %}
{{ 'products.product.sold_out' | t }}
{{ settings.product_grid_label_title }}
{{ 'products.product.on_sale' | t }}
{% else %}-{{ product.compare_at_price | minus: product.price | times: 100.0 | divided_by: product.compare_at_price | round }}%
{% endif %}{{ 'products.product.new' | t }}
{% endif %}
{% case settings.product_grid_image_size %}
{% when ânaturalâ %}
{%- assign product_ratio = âcustomâ -%}
{% when âfit-squareâ or âcrop-squareâ %}
{%- assign product_ratio = â1:1â -%}
{% when âfit-shortâ or âcrop-shortâ %}
{%- assign product_ratio = â4:3â -%}
{% when âfit-tallâ or âcrop-tallâ %}
{%- assign product_ratio = â2:3â -%}
{% endcase %}
{% if settings.product_grid_second_hover and product.images[1] != blank %}
{%- assign img_url = product.featured_image.src | img_url: â1x1â | replace: â1x1.', '{width}x.â -%}
{% unless settings.product_grid_quick_buy == âdisabledâ %}
{% if settings.product_grid_vendor %}
{% include 'product-price' %}
{% if product.available and product.selected_or_first_available_variant.unit_price_measurement %}{% include 'product-unit-price', variant: product.selected_or_first_available_variant %}
{% endif %} {% endif %}{% if settings.product_grid_swatch %}
{% include âproduct-grid-swatchâ %}
{% endif %}
{% if settings.product_reviews and settings.product_grid_reviews %}
Hi @thosewhobloom ,
Please change code:
{% if settings.product_grid_label %}
{% assign custom_label = false %}
{% for collection in product.collections %}
{% if collection.title == collections[settings.product_grid_label_collection].title %}
{% assign custom_label = true %}
{% endif %}
{% endfor %}
{% assign new_label = false %}
{% assign product_created_at = product.created_at | date: '%s' %}
{% assign time_ago = 'now' | date: '%s' | minus: product_created_at | divided_by: 86400 %}
{% if time_ago < settings.product_grid_label_new_days %}
{% assign new_label = true %}
{% endif %}
{% if product.available == false %}
{{ 'products.product.sold_out' | t }}
{% elsif custom_label %}
{{ settings.product_grid_label_title }}
{% elsif product.compare_at_price > product.price %}
{% if settings.product_grid_label_sale_style == 'text' %}
{{ 'products.product.on_sale' | t }}
{% else %}
-{{ product.compare_at_price | minus: product.price | times: 100.0 | divided_by: product.compare_at_price | round }}%
{% endif %}
{% elsif new_label and settings.product_grid_label_new %}
{{ 'products.product.new' | t }}
{% endif %}
{% endif %}
{% case settings.product_grid_image_size %}
{% when 'natural' %}
{%- assign product_ratio = 'custom' -%}
{% when 'fit-square' or 'crop-square' %}
{%- assign product_ratio = '1:1' -%}
{% when 'fit-short' or 'crop-short' %}
{%- assign product_ratio = '4:3' -%}
{% when 'fit-tall' or 'crop-tall' %}
{%- assign product_ratio = '2:3' -%}
{% endcase %}
{% if settings.product_grid_second_hover and product.images[1] != blank %}
{% endif %}
{%- assign img_url = product.featured_image.src | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
{% unless settings.product_grid_quick_buy == 'disabled' %}
{% if product.available == false %}
{{ 'products.product.sold_out' | t }}
{% elsif product.variants.size > 1 %}
{{ 'products.product.select_options' | t }}
{% else %}
{% form 'product', product, class: "js-product-form" %}
{% endform %}
{% endif %}
{% endunless %}
### {{ product.title }}
### {{ product.type }}
{% if settings.product_grid_vendor %}
#### {{ product.vendor }}
{% endif %}
{% if settings.product_grid_price %}
{% include 'product-price' %}
{% if product.available and product.selected_or_first_available_variant.unit_price_measurement %}
{% include 'product-unit-price', variant: product.selected_or_first_available_variant %}
{% endif %}
{% endif %}
{% if settings.product_grid_swatch %}
{% include 'product-grid-swatch' %}
{% endif %}
{% if settings.product_reviews and settings.product_grid_reviews %}
{% endif %}
If it helped you solve your issue, please mark it as a solution. Thank you and good luck.
Thank you @LitCommerce !
@LitCommerce One last question. Would there be an easy way to have it displayed as (product type) from (vendor)?
Such as âPrint from Jessica Rouxâ, all in the same line?
Or Postcard (type) from Jessica Roux (vendor) for example
Hi @thosewhobloom ,
Please find and change code here:
Code:
### {{ product.type }} from {{ product.vendor }}
Hope it helps!
@LitCommerce Thanks so much! Worked perfectly.