How to add horizontal line with custom liquid code

Solved

How to add horizontal line with custom liquid code

INKLY
Pathfinder
141 0 18

Hi, I would like to add a horizontal line below the price on my product page like this: 

INKLY_0-1721130741391.png

 

I tried this: 

INKLY_1-1721130767032.png

But the padding is too big. Does anyone know how I can achieve something like on the Bleame website? Thank you for your help. 

 

Best regards,

Store URL: https://inkly.fr/?_ab=0&_fd=0&_sc=1&preview_theme_id=163175923977

 

 

Accepted Solution (1)

BSSCommerce-HDL
Shopify Partner
2305 835 907

This is an accepted solution.

Hi @INKLY

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag: 

<style>
  .price.price--large.price--on-sale {
    padding-bottom: 20px;
    margin-bottom: 30px;
    position: relative;
}

.price.price--large.price--on-sale:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #00000017;
    bottom: 0;
    left: 0;
}
</style>

Here is result: 

BSSCommerceHDL_0-1721131373492.png

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

Replies 6 (6)

Moeed
Shopify Partner
6963 1878 2295

Hey @INKLY 

 

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>
div#price-template--21926318113033__main {
    border-bottom: solid 1px #00000038;
    padding-bottom: 10px !important;
}
</style>

RESULT:

Moeed_0-1721131368894.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


INKLY
Pathfinder
141 0 18

Thanks that's exactly what I wanted. However the text below is a bit too close from the line, do you mind helping me solve that? Thank you! 

INKLY_0-1721132070193.png

 

Moeed
Shopify Partner
6963 1878 2295

Hey @INKLY 

 

Keep the previous code and add this new code above </style> in the end of theme.liquid file.

p.product__text.inline-richtext:nth-child(8) {
    padding-top: 20px !important;
}

RESULT:

Moeed_0-1721132816339.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


BSSCommerce-HDL
Shopify Partner
2305 835 907

This is an accepted solution.

Hi @INKLY

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag: 

<style>
  .price.price--large.price--on-sale {
    padding-bottom: 20px;
    margin-bottom: 30px;
    position: relative;
}

.price.price--large.price--on-sale:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #00000017;
    bottom: 0;
    left: 0;
}
</style>

Here is result: 

BSSCommerceHDL_0-1721131373492.png

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

INKLY
Pathfinder
141 0 18

Thank you very much !

BSS-TekLabs
Shopify Partner
2401 695 831

- Here is the solution for you @INKLY 
- Please follow these steps:

step.png

- Then find the base.css file.
- Then add the following code at the end of the file and press 'Save' to save it.

    .price--large {
            border-bottom: solid 1px black !important;
    padding-bottom: 10px !important;
    }

- Here is the result you will achieve:

BSSTekLabs_0-1721131542694.png

 

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now