Add text after product price - Dawn Theme

Add text after product price - Dawn Theme

PobladoCoffi
Excursionist
14 0 2

Hi,

 

I want to add text after the price on a certain product in the Dawn theme. For example, if the price if £25.00, I want it to say £25.00 Monthly (adding "Monthly") after the price. How would I go about doing that?

 

Thanks!

Replies 5 (5)

brandography
Shopify Partner
136 27 25

You could try adding this on a new line below line 205 in your main-product.liquid file and clicking Save:

<span>monthly</span>

 

Find a Powerful eCommerce Marketing Partner


Let Brandography help you spread the word about your products through cutting-edge eCommerce web design, strategic sales channels, and expert digital marketing tactics.
Check out our website
Mr_RaviRaj
Shopify Partner
505 57 109

@PobladoCoffi 

Follow this for:

1. Open snippet->product-price.liquid find below code:

<div class="price__sale">
<dt>
<span class="visually-hidden visually-hidden--inline">{{ 'products.product.sale_price' | t }}</span>
</dt>
<dd>
<span class="price-item price-item--sale" data-sale-price>
{{ money_price }}
</span>
<span class="price-item__label" aria-hidden="true">{{ 'products.product.on_sale' | t }}</span>
</dd>
</div>

Now add below code just next to this :

<span class="m_price">Monthly</span>

So it look like:

<div class="price__sale">
<dt>
<span class="visually-hidden visually-hidden--inline">{{ 'products.product.sale_price' | t }}</span>
</dt>
<dd>
<span class="price-item price-item--sale" data-sale-price>
{{ money_price }}
</span>
<span class="price-item__label" aria-hidden="true">{{ 'products.product.on_sale' | t }}</span>
</dd>
</div>
<span class="m_price">Monthly</span>

 Thank you.

banned
shamrockshirts
New Member
4 0 0

This works but the text is on the line under the price rather than after it on the same line. How can I display this on the same line as the price?

PobladoCoffi
Excursionist
14 0 2

Is there a way to only have it show on one product?

KristinW
Excursionist
34 2 5

@PobladoCoffi - you probably have this solved now, but if you want to make a change for just one product you can copy 'main-product.liquid' and make changes on the new version 'copy-main-product.liquid.' Then copy the product template and where it says 'main-product.liquid' change to 'copy-main-product.liquid' (or whatever you name it). 

 

Were you able to get text on the same line as price? I can't figure that out - wherever I enter it, it shows on either the line above or the line below? @shamrockshirts @Mr_RaviRaj 

 

main-product.liquid

 

{%- when 'price' -%}
<div class="no-js-hidden" id="price-{{ section.id }}" role="status" {{ block.shopify_attributes }}>
{%- render 'price',
product: product,
use_variant: true,
show_badges: true,
price_class: 'price--large'
-%}
<span>/ each</span>
</div>