Creating a new badge

Solved

Creating a new badge

robertsolcan
Excursionist
31 0 2

Hello! Do you happen to know how can I create a badge that will help me in adding more information to my product's card? It would be very helpful for me! It should look something like this: 

Screenshot 2024-08-29 at 14.12.24.png

Accepted Solution (1)

GTLOfficial
Shopify Partner
471 92 90

This is an accepted solution.

Hello @robertsolcan 
Go to online store ----> themes ----> actions ----> edit code---->find file product-card--------> in line number 140 after</span>

add this code 

  {%- elsif  card_product.metafields.custom.badge!= blank -%}
              <span
                id="NoMediaStandardBadge-{{ section_id }}-{{ card_product.id }}"
                class="badge badge--bottom-left">
               {{ card_product.metafields.custom.badge}}
              </span>


and save it

step 2:->

Go to online store ----> settings----> Content---------> metafiels-------------> product-------------> create a meta field name "badge" -------------->
select single-line text

and save it

Now you can assign custom badge in your products metafields and it will start showing

Please let me know if you have any question

Thanks

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: info@gtlofficial.com - Skype: ritesh_27dh

View solution in original post

Replies 4 (4)

Small_Task_Help
Shopify Partner
775 25 69

Hi,

 

At product card template need to ad Badge HTML

HTML example

<div class="product-card">
  <!-- Product Image -->
  <img src="{{ product.featured_image | img_url: 'medium' }}" alt="{{ product.title }}">
  
  <!-- Badge -->
  {% if product.tags contains 'new' %}
    <div class="badge badge-new">New</div>
  {% endif %}
  
  <!-- Product Title -->
  <h3>{{ product.title }}</h3>
  
  <!-- Product Price -->
  <p>{{ product.price | money }}</p>
</div>

Use CSS for styling and check responsive design 

You can also use metafields to store additional information and display badges based on metafield values

To Get Shopify Experts Help, E-mail - hi@ecommercesmalltask.com
About Us - We are Shopify Expert Agency
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad

GTLOfficial
Shopify Partner
471 92 90

This is an accepted solution.

Hello @robertsolcan 
Go to online store ----> themes ----> actions ----> edit code---->find file product-card--------> in line number 140 after</span>

add this code 

  {%- elsif  card_product.metafields.custom.badge!= blank -%}
              <span
                id="NoMediaStandardBadge-{{ section_id }}-{{ card_product.id }}"
                class="badge badge--bottom-left">
               {{ card_product.metafields.custom.badge}}
              </span>


and save it

step 2:->

Go to online store ----> settings----> Content---------> metafiels-------------> product-------------> create a meta field name "badge" -------------->
select single-line text

and save it

Now you can assign custom badge in your products metafields and it will start showing

Please let me know if you have any question

Thanks

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: info@gtlofficial.com - Skype: ritesh_27dh

Valentyna1
Shopify Partner
2 0 1

Hello @robertsolcan !
You can try a free app - Lably (https://apps.shopify.com/lably ). It allows you to create and customize labels and badges for your products.

Amanda_Fordeer
Shopify Partner
98 8 28

Hi @robertsolcan

You can experiment with a third-party application such as Product Labels & Badges. This application currently permits you to generate various labels swiftly.

 

Here are the steps to follow:

 

1. Install and activate the embedded app.

2. Establish a Label or Bundle Label campaign.

Amanda_Fordeer_0-1725095043670.png

3. Customize your labels to align with your brand.

Amanda_Fordeer_1-1725096273789.png

4. Apply the labels to your products.

Amanda_Fordeer_2-1725096448955.png

5. Save your changes and verify them.

If you find my suggestion helpful, please give it a like or mark it as a solution!
And discover more approaches to:
Streamline invoicing process Boost sales with labels & badges Add social proofs & create FOMO
Or get valuable updates and private deals regarding Shopify here.