Shopify themes, liquid, logos, and UX
I’m trying to find a way to hide prices on collection and product pages for sold-out items in the Impact Theme. I’ve tested a few methods I found for other themes, but none seem to work with Impact.
Thank you
Hi @Nardurna
Could you share our store URL so I can check?
- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Thanks for replying. Sure, it is nardurna.com but I don't have the Impact theme live as yet, I need it to be right before publishing
Hi @Nardurna ,
If you'd like to hide the price for products that are not available in your store, you can do so by adding a simple code snippet to your product_card and main-product sections.
In the product_card snippet, insert the following if condition before the price is displayed:
{%- if card_product.available == true -%}
In the main-product section, insert this if condition before the price is displayed:
{%- if product.available == true -%}
This will ensure that prices are only shown for available products.
If you need further assistance, feel free to reach out!
I hope this helps! If it does, please like it and mark it as a solution!
Regards,
Sweans
Thank you Sweans,
I just tried to paste it into the product_card snippet but cannot find where to place it. There is only one mention of price. Please see screenshot.
Thank you
Hi @Nardurna ,
To update your code and conditionally display the product price only when it is available, replace the selected code with the following:
{%- if product.available == true -%}
{%- render 'price-list', product: product, text_alignment: text_alignment -%}
{% endif %}
This will ensure that the price is displayed only for products that are available.
If you find this information useful, a Like would be greatly appreciated.
If this solves the problem, please Mark it as Solution!
Regards,
Sweans
Hi @Nardurna
Go to your Shopify admin panel.
Click on "Online Store" and then "Themes.
Find the Impact theme and click "Actions" and then "Edit code.
In the theme code editor, locate the product-template.liquid file. It is usually found in the "Sections" or "Templates" folder.
Look for the code that displays the product price. It might look something like this:
<span class="product-price">{{ product.price | money }}</span>
Modify the code to include a condition that checks if the product is sold out. You can use the product.available attribute to determine if the product is in stock.
{% if product.available %}
<span class="product-price">{{ product.price | money }}</span>
{% endif %}
This code checks if the product is available and only displays the price if it is in stock.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024