How to alter the text on a sale badge?

I want to show 9% OFF or SALE in Sale badge

kindly give a solutions to change this text

https://isiro.ca/products/anti-theft-durable-laptop-backpack?variant=39814587810075

1 Like

@obaidbadsha

yes, please share product page code so i will check and update

hello @KetanKumar here are product.liquid file code

============================

{%- if collection == blank and product.collections.first != blank -%}{%- assign collection = product.collections.first -%}{%- endif -%}
{%- case settings.design_products -%}
{%- when ‘2’ -%}
{%- assign singles_wc = ‘nt-single-2’ -%}
{%- when ‘3’ -%}
{%- assign singles_wc = ‘nt-single-3’ -%}
{%- else -%}
{%- assign singles_wc = ‘nt-single-1’ -%}
{%- endcase -%}
{%- case settings.size_img_pr -%}
{% when ‘1’ %}
{%- assign class_images = ‘col-lg-4’ -%}
{%- assign class_summary = ‘col-lg-8’ -%}
{% when ‘2’ %}
{%- assign class_images = ‘col-md-6’ -%}
{%- assign class_summary = ‘col-md-6’ -%}
{% when ‘3’ %}
{%- assign class_images = ‘col-lg-7’ -%}
{%- assign class_summary = ‘col-lg-5’ -%}
{%- endcase -%}
{%- assign page_pr_img_size = settings.use_eq_thumb_height -%}
{%- assign nav_pr_img_size = settings.use_eq_nav_height -%}
{%- assign has_size_guide = false -%}
{%- assign btn_atc_full = false -%}
{%- assign nt_suffix = ‘not_group_images’ -%}
{%- assign first_available_variant = settings.first_available_variant -%}
{%- if product.selected_variant != blank and first_available_variant == false -%}
{%- assign current_variant = product.selected_variant -%}
{%- elsif first_available_variant == false -%}
{%- assign current_variant = product.variants.first -%}
{%- else -%}
{%- assign current_variant = product.selected_or_first_available_variant -%}
{%- endif -%}
{%- assign featured_image = current_variant.featured_image | default: product.featured_image -%}
{%- assign product_image_zoom_size = ‘master’ -%}
{%- assign product_image_scale = ‘2’ -%}
{%- assign cv_color = ‘nt-p-item’ -%}
{%- assign nt_carousel = ‘nt-carousel’ -%}
{%- include ‘nt_check_label’ -%}
{%- if settings.use_wishlist -%}{%- include ‘nitro-wishlist’ -%}{%- endif -%}
{%- if product.metafields.external -%}
{%- assign check = product.metafields.external | first | last -%}
{%- if check contains ‘https:’ or check contains ‘http:’ -%}{%- assign check_external = true -%}{%-else-%}{%- assign check_external = false -%}{%-endif-%}
{%-endif-%}
{%- if settings.show_share_btn and settings.share_type == ‘1’ -%}
{%- assign gl_follow_social = false -%}
{%- elsif settings.show_share_btn and settings.share_type == ‘2’ -%}
{%- assign gl_follow_social = true -%}
{%- endif -%}
{%- assign stock_countdow = true -%}
{%- if settings.gecko_stock_countdown == false -%}
{%- assign stock_countdow = true -%}
{%- elsif settings.gecko_stock_countdown and settings.stock_message == blank -%}
{%- assign stock_countdow = true -%}
{%- endif -%}
{%- assign estimateStartDate = settings.delivery_start -%}
{%- assign estimateEndDate = settings.delivery_end -%}
{%- if product.metafields.meta.estimateStartDate != blank -%}
{%- assign estimateStartDate = product.metafields.meta.estimateStartDate | plus:0 -%}
{%- endif -%}
{%- if product.metafields.meta.estimateEndDate != blank -%}
{%- assign estimateEndDate = product.metafields.meta.estimateEndDate | plus:0 -%}
{%- endif -%}
{%- assign remove_unavailable = true -%}
{%- assign remove_soldout = settings.remove_sold_out -%}

{{ 'general.breadcrumbs.home' | t }}{%- if template contains 'product' and collection.url -%}{{ collection.title }}{%- endif -%}{{ product.title }} {%- if settings.show_back_next_pr -%} {%- if collection.next_product or collection.previous_product -%} {%- assign image_size = '80x' -%}
{%- if collection.previous_product -%}
{%- if collection.previous_product.images.size > 0 -%} {{ collection.previous_product.title | escape }} {%- endif -%} {{collection.previous_product.title}} {%- if collection.previous_product.price_varies -%} {{ collection.previous_product.price_min | money }} – {{ collection.previous_product.price_max | money }} {%- elsif collection.previous_product.compare_at_price > collection.previous_product.price -%}{{ collection.previous_product.compare_at_price | money }} {{ collection.previous_product.price | money }} {%- else -%} {{ collection.previous_product.price | money }} {%- endif -%}
{%- endif -%} {%- if collection.next_product -%}
{%- if collection.next_product.images.size > 0 -%} {{ collection.next_product.title | escape }} {%- endif -%} {{collection.next_product.title}} {%- if collection.next_product.price_varies -%} {{ collection.next_product.price_min | money }} – {{ collection.next_product.price_max | money }} {%- elsif collection.next_product.compare_at_price > collection.next_product.price -%}{{ collection.next_product.compare_at_price | money }} {{ collection.next_product.price | money }} {%- else -%} {{ collection.next_product.price | money }} {%- endif -%}
{%- endif -%}
{%- endif -%} {%- endif -%}
{%- assign ck_thumb = false -%}{%- if nt_suffix == 'group_images' and cv_color != 'nt-p-item' -%}{%- assign ck_thumb = true -%}{%- endif -%} {%- case settings.design_products -%} {%- when '1' -%} {%- include 'product_layout_1' -%} {%- when '2' -%} {%- include 'product_layout_2' -%} {%- when '3' -%} {%- include 'product_layout_3' -%} {%- when '4' -%} {%- include 'product_thumb_bottom' -%} {%- else -%} {%- include 'product_thumb_right' -%} {%- endcase -%}
{%- if settings.use_sticky_des and singles_wc != 'nt-single-3' -%}
{%- endif -%}

{{ product.title }}

{%- if settings.use_flash_sold and product.available -%}
{%- if settings.flash_sold_img != blank -%} {{settings.flash_sold_img.alt | default:'flash sale' }} {%- endif -%} {{ 'products.nt_extra.flash_sold' | t }} {{ 'products.nt_extra.flash_hours' | t }}
{%- endif -%} {%- if settings.show_product_page_rating -%} {%- if settings.app_review == '1' -%} {%- else -%}
{%- endif -%}
{%- endif -%} {% render 'judgeme_widgets', widget_type: 'judgeme_preview_badge', jm_style: 'margin-top:-15px;margin-bottom:-5px;', concierge_install: true, product: product %}

{%- if linklists[product.handle].links.size == 0 -%} {%- if product.price_varies -%} {%- if settings.price_format == '1' -%} {{ product.price_min | money }} – {{ product.price_max | money }} {%- else -%} {{ 'products.product.from' | t }} {{ product.price_min | money }} {%- endif -%} {%- elsif on_sale -%}{%- assign save = current_variant.compare_at_price | minus: current_variant.price | times: 100.0 | divided_by: current_variant.compare_at_price | ceil -%}{{ current_variant.compare_at_price | money }} {{ current_variant.price | money }} {{ 'products.product.save_js' | t: saved_amount:save }} {%- else -%} {{ current_variant.price | money }} {%- endif -%} {%- else -%} {%- if on_sale -%} {{ product.price | money }}–{{ product.compare_at_price | money }} {%- elsif product.price_varies -%} {{ product.price_min | money }}–{{ product.price_max | money }} {%- else -%} {{ product.price | money }} {%- endif -%} {%- endif -%}

{%- if settings.use_description_excerpt -%} {%- assign _prodcut_excerpt_length = settings.prodcut_excerpt_length | plus:0 -%} {%- assign prodcut_excerpt_length = _prodcut_excerpt_length | default: 31 -%}

{%- if product.metafields.meta.description_excerpt -%} {{ product.metafields.meta.description_excerpt | strip_html }} {%- elsif product.metafields.global.description -%} {{ product.metafields.global.description | strip_html }} {% elsif product.description contains '[' %} {% assign pr_des = product.description | split: '[' %} {% assign pr_des = pr_des[1] | split: ']' | first | append:']' | prepend:'[' %} {{ product.description | remove: pr_des | strip_html | truncatewords: prodcut_excerpt_length }} {%-else-%} {{ product.description | strip_html | truncatewords: prodcut_excerpt_length }} {%-endif-%}

{%- endif -%} {%- if product.available -%} {%- if settings.show_countdown or settings.gecko_stock_countdown -%}{%- include 'nt_countdow_page' -%}{%- endif -%} {%- endif -%}
{%- if linklists[product.handle].links.size == 0 -%} {%- if product.has_only_default_variant == false and product.variants.size > 1 -%}
{%- form 'product', product, id: "cart-form", class: "nt_cart_form variations_form product-form nt_cart clearfix" -%} {%- include settings.swatch_design,class_input:'pr' -%} {%- if product.price_varies -%}
{%- if on_sale -%}{%- assign save = current_variant.compare_at_price | minus: current_variant.price | times: 100.0 | divided_by: current_variant.compare_at_price | ceil -%}{{ current_variant.compare_at_price | money }} {{ current_variant.price | money }} {{ 'products.product.save_js' | t: saved_amount:save }} {%- else -%} {{ current_variant.price | money }} {%- endif -%}
{%- endif -%} {%- if settings.product_quantity_message and stock_countdow -%}
{%- endif -%}
{%- if settings.use_notify_me == false -%}

{{ 'products.product.outofstock' | t }}

{%- endif -%} {%- if check_external -%} {{ product.metafields.external | first | first }} {%- elsif current_variant.inventory_quantity <= 0 and current_variant.available and current_variant.inventory_management == 'shopify' -%} {{ 'products.product.pre_orders' | t }} {%- else -%} {{ 'products.product.add_to_cart' | t }} {%- endif -%}
{%- if settings.enable_payment_button and check_external == false -%}
{{ 'products.product.or' | t }}
{{ form | payment_button }} {%- endif -%} {%- endform -%}
{%- if settings.use_notify_me -%}

{{ 'products.product.outofstock' | t }}

{%- form 'contact',class:'frm_notify w_100' -%} {%- assign formId = 'ContactForm' | append:current_variant.id -%} {%- include 'form-status', formId,notify_me:'1' -%}

{{ 'products.product.title_notify_me' | t }}

{%- if customer and customer.name != blank -%}
{{ 'contact.form.name' | t }}
{%- endif -%}
{{ 'contact.form.email' | t }} *
{{ 'contact.form.message' | t }} {{ 'products.product.please_notify_me' | t: title:product.title,variant:'current_variant_title',url:'current_variant_title_url' }}
{%- endform -%}
{%- endif -%} {%- else -%} {%- if current_variant.inventory_management and settings.product_quantity_message and stock_countdow -%} {%- if current_variant.inventory_quantity < 10 and current_variant.inventory_quantity > 0 -%}
{{ 'products.product.only_left' | t: count: current_variant.inventory_quantity }}
{%- elsif current_variant.inventory_quantity <= 0 and current_variant.incoming -%} {%- assign next_incoming_date = current_variant.next_incoming_date | date: format: 'month_day_year' -%}
{{ 'products.product.will_not_ship_until' | t: date:next_incoming_date }}
{%- endif -%} {%- endif -%} {%- if sold_out -%} {%- if settings.use_notify_me -%}
{%- form 'contact',class:'frm_notify w_100' -%}

{{ 'products.product.title_notify_me' | t }}

{%- assign formId = 'ContactForm' -%} {%- include 'form-status', formId,notify_me:'1' -%} {%- if form.posted_successfully? == false -%}
{%- if customer and customer.name != blank -%}
{{ 'contact.form.name' | t }}
{%- endif -%}
{{ 'contact.form.email' | t }} *
{{ 'contact.form.message' | t }} {%- assign url_js = shop.url | append:'/' | append:product.url -%} {{ 'products.product.please_notify_me' | t: title:product.title,variant:'current_variant_title',url:url_js | remove: ' - current_variant_title'}}
{%- endif -%} {%- endform -%}
{%- else -%}

{{ 'products.product.outofstock' | t }}

{%- endif -%} {%- else -%} {%- form 'product', product, id: "cart-form", class: "nt_cart_form variations_form product-form nt_cart clearfix" -%} {%- if product.variants.size == 1 and product.has_only_default_variant == false -%}{%- include settings.swatch_design,class_input:'pr',cl_selected:'is-selected' -%}{%- endif -%}
{%- if check_external -%} {{ product.metafields.external | first | first }} {%- elsif current_variant.inventory_quantity <= 0 and current_variant.available and current_variant.inventory_management == 'shopify' -%} {{ 'products.product.pre_orders' | t }} {%- else -%} {{ 'products.product.add_to_cart' | t }} {%- endif -%}
{%- if settings.enable_payment_button and check_external == false -%}
{{ 'products.product.or' | t }}
{{ form | payment_button }} {%- endif -%} {%- endform -%} {%- endif -%} {%- endif -%} {%- else -%} {%- include 'product_group' -%}
{%- if check_external == false -%} {{ 'products.product.add_to_cart' | t }} {%- else -%} {{ product.metafields.external | first | first }} {%- endif -%}
{%- assign has_size_guide = true -%} {%- endif -%}
{%- if settings.enable_delivery_order and product.available -%}
{%- if settings.delivery_order_img != blank -%} {{settings.delivery_order_img.alt | default:'delivery order' }} {%- endif -%} {{ 'products.nt_extra.estimateTimer_1' | t }} {{ 'products.nt_extra.estimateTimer_2' | t }}
{%- endif -%} {%- if settings.show_real_time_visitor -%}
{{settings.text_real}} 94 {{settings.text_visitor}}
{%- endif -%} {%- if settings.product_img_trust_seal and settings.img_trust_seal != blank -%} {%- assign image = settings.img_trust_seal -%} {%- assign image_size = '550x' -%}
{{image.alt}}
{%- endif -%}
{%- if pages[settings.delivery_return].content != blank -%} {{ 'products.product.delivery_return' | t }} {%- endif -%} {%- if has_size_guide and settings.size_chart -%} {%- if product.metafields.meta.image_size_chart != blank or collection.metafields.meta.image_size_chart != blank or settings.image_size_chart != blank %} {{ 'products.product.product_size_guide' | t }} {%- endif -%} {%- endif -%}
{%- if settings.show_share_btn -%}
{{ 'products.product.product_share' | t }} {%- include 'social-sharing', follow_social:gl_follow_social,nt_tooltip:true,class_tooltip:'tooltip_top_right' -%}
{%- endif -%} {%- if settings.description_products == '3' -%}
{%- section 'product-page-description' -%}
{%- endif -%} {%- if settings.use_sticky_des and singles_wc != 'nt-single-3' -%}
{%- endif -%}
{%- if settings.description_products != '3' -%} {%- section 'product-page-description' -%} {%- endif -%} {%- if collection.next_product or collection.previous_product -%} {{ 'products.product.previous_product' | t }} {{ 'products.product.back_cat' | t }} {{ 'products.product.next_product' | t }} {%- endif -%}
{%- assign ck_meta = false -%} {%- capture meta -%} {%- if settings.show_pr_vendor and product.vendor != blank -%} {%- assign ck_meta = true -%} {{ 'products.product.product_vendor' | t }} {{ product.vendor | link_to_vendor }} {%- endif -%} {%- if settings.show_sku -%} {%- assign ck_meta = true -%} {{ 'products.product.product_sku' | t }} {%- if current_variant.sku != blank -%}{{current_variant.sku}}{%-else-%}{{ 'products.product.na' | t }}{%-endif-%} {%- endif -%} {%- if settings.show_available -%} {%- assign ck_meta = true -%} {{ 'products.product.available' | t }} {%- if sold_out -%}{{ 'products.product.outofstock' | t }}{%- else -%}{{ 'products.product.in_stock' | t }}{%- endif -%} {%- endif -%} {%- if product.collections.size > 0 and settings.show_category_product -%} {%- assign ck_meta = true -%} {{ 'products.product.product_category' | t }} {% for collection in product.collections -%}{{ collection.title | link_to: collection.url }}{%- if forloop.last == false -%}, {% endif -%}{%- endfor -%} {%- endif -%} {%- if product.tags.size > 0 and settings.show_tag_product and product.collections.size > 0 -%} {%- assign ck_meta = true -%} {{ 'products.product.product_tag' | t }} {% for tag in product.tags -%} {{ tag | remove:'type ' | remove:'Type ' }}{%- unless forloop.last -%}, {% endunless -%} {%- endfor -%} {%- endif -%} {%- endcapture -%} {%- if ck_meta -%}
{{meta}}
{%- endif -%}
{%- if settings.show_related_products -%} {%- include 'related-products-sectioned' -%} {%- endif -%} {%- if settings.show_recently_products and pages['recently-viewed-products'].empty? != true -%}{%- include 'nt-recently-viewed' -%}{%-endif-%} {%- if product.metafields.meta.hashtag != blank or product.metafields.meta.username != blank -%}{%- include 'pr_instagram' -%}{%-endif-%}
{% include 'amazon-product-reviews' with 'product' %}
{% include 'aliexpress_reviews' %}

Hi @obaidbadsha ,

You can follow the following steps:

  1. Access to the partner link:

  1. Go to Online store > Themes > Add the script below:

However, this solution is only temporary. If you don’t use labels anymore, you can delete the above script. In case you want to create and use labels/badges easier, I suggest you consider using some 3rd-party app that allows you to create custom labels/badges, or even apply them to each product condition.

I hope that it’s useful to you. Let me know if you need further help.

this code is not working, i want to show SALE text in all of the product badges

kindly help me

Hi @obaidbadsha

  • The script only changes the existing labels, which meet the original criteria.

  • If you want the label to apply to products/collections, then I think you should use a 3rd-party app (maybe free or paid) as creating a short script to apply to the entire page seems to be impossible. The 3rd-party app will help you to check the condition of each product/collection/tag/ .. . and a lot of user configs).

thank you for your suggestion, can you suggest an app like this?