Shopify themes, liquid, logos, and UX
Hi there, I'm using DAWN theme and I have a few products that are only available in-store (Large items etc), but not all of them.
I would like to add a badge to those items, like the [SALE] buttons.
How can I do this?
- you can add custom tag to these products like "store" , you will need to do this manually
- then edit code on product template to check if this tag is present in product, if yes then show badge
this will need code editing.
Hello @Healthfarm
need to add a tag on products on which you want to show only button.
for example added tag is "available-in-store" than go to product template section and use below code to identify show button or not
{% assign productTags = product.tags | join:',' %}
{% if productTags contains 'available-in-store' %}
BUTTON CODE GOES HERE
{% endif %}
In this tutorial, I will discuss the important aspect of WooCommerce shop page customization that results in a better-customized user experience. As always, I assume that you have a working WooCommerce store with optimized settings (preferably on Cloudways. If not, sign up for your free trial). If you don’t, you can go through the WooCommerce tutorial I have created for your help.
Hello @Healthfarm,
Follow these steps to add a Sale button to specific items.
Hope it is helpful. Lets us know if you have any questions.
All the best,
Team CedCommerce
Hi there, thank you for your reply but I cannot see the image as it is too small.
So I opened "card_product.liquid” file and searched the [badge] and this is what appeared.
<div class="card__badge {{ settings.badge_position }}">
{%- if card_product.available == false -%}
<span class="badge badge--bottom-left color-{{ settings.sold_out_badge_color_scheme }}">{{ 'products.product.sold_out' | t }}</span>
{%- elsif card_product.compare_at_price > card_product.price and card_product.available -%}
<span class="badge badge--bottom-left color-{{ settings.sale_badge_color_scheme }}">{{ 'products.product.on_sale' | t }}</span>
{%- endif -%}
What code should I put so I can make the [In-store Only] button appear?
Thank you
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024