Re: Custom Badge change of color and position

Solved

Custom Badge change of color and position

Karla8
Explorer
57 0 13

Hello all,

 

After checking various tutorial I managed to add a "bundle" badge on the collections page using the following code on card.product.liquid

 

{% if card_product.tags contains 'Bundle' %}
<span class="badge badge__Bundle">Bundle</span>
{% endif %}

 

then I tried to change the color with the following code on component-card.css

 

.badge__Bundle {
background-color: #ff87bd;
color: #fff;
}

 

And of course I tried to move it to the right side without success.

 

www.hintofhappiness.com

 

Any input is highly appreciated !

 

Karla

Accepted Solution (1)

Moeed
Shopify Partner
6736 1820 2202

This is an accepted solution.

Hey @Karla8 

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

 

<style>
span.badge.badge__Bundle {
    background: #ff87bd !important;
    border-color: #ff87bd !important;
}
.card__badge {
    justify-self: flex-end !important;
}
</style>

 

RESULT:

Moeed_0-1719168351889.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


View solution in original post

Replies 3 (3)

Moeed
Shopify Partner
6736 1820 2202

This is an accepted solution.

Hey @Karla8 

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

 

<style>
span.badge.badge__Bundle {
    background: #ff87bd !important;
    border-color: #ff87bd !important;
}
.card__badge {
    justify-self: flex-end !important;
}
</style>

 

RESULT:

Moeed_0-1719168351889.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


Karla8
Explorer
57 0 13

that was incredible fast. I've been trying for the last few hours haha. thank you so much !

Moeed
Shopify Partner
6736 1820 2202

Thank you for your reply. I'm glad to hear that the solution worked well for you. If you require any more help, please don't hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications