Hide Price On Select Products

TrentTrent Member Posts: 8

Hi all, 

We have situations in our store where we need to hide the price on some items. 

Can I override the price and insert "P.O.A." (Price on Application) on selected product pages? 


I have tried to use translations:


ie: 

change the price to 987654 and go to content > translations > Add custom translation. 

Translation Key: $ 987,654.00

Translation to english: P.O.A. 

This did not work. 


I have also tried editing the pages/product.rain template. Here's my original code for price div: 

 <div class="price">

     {% if product.price.price_old %}<div class="from">{{ "Suggested: " }}{% if shop.settings.legal.mode == 'strict' %}<span class="avp">{{ 'SRP' | t }} </span>{% endif %}<span>{% if theme.show_currencies %}{{ shop.currency2.symbol }} {% endif %}{{ product.price.price_old | money_without_currency | replace({',00':',-'}) }}</span></div>{% endif %}

     <div class="for">

      {% if theme.show_currencies %}{{ shop.currency2.symbol }} {% endif %}{{ product.price.price | money_without_currency | replace({',00':',-'}) }}{% if shop.settings.legal.mode == 'strict' %}*{% endif %}

      {% if shop.b2b %}<span class="tax">{{ 'Excl. VAT' | t }}</span>{% endif %}

      {% if theme.show_stock_amount or theme.toon_voorraad or (theme.show_delivery_time and product.stock.delivery) %}

       {% if product.stock.available %}

        <div class="hurry"><i class="icon-check-white"></i> {% if theme.show_stock_amount %}{{ product.stock.level }} {% endif %}{% if theme.toon_voorraad %} {{ 'In stock' | t }}{% endif %}{% if theme.toon_voorraad and product.stock.delivery and theme.show_delivery_time %}: {% endif %}{% if product.stock.delivery and theme.show_delivery_time %}{{ product.stock.delivery.title | raw }}{% endif %}</div>

       {% else %}

        <div class="hurry too-late"><i class="icon-negative"></i> {% if theme.toon_voorraad %}{{ 'Out of stock' | t }}{% endif %}{% if theme.toon_voorraad and product.stock.delivery and theme.show_delivery_time %}: {% endif %}{% if product.stock.delivery and theme.show_delivery_time %}{{ product.stock.delivery.title | raw }}{% endif %}</div>

       {% endif %}

      {% endif %}

     </div>

Here's the same but with custom code I have inserted: 

 <div class="price">

     {% if product.price.price_old %}<div class="from">{{ "Suggested: " }}{% if shop.settings.legal.mode == 'strict' %}<span class="avp">{{ 'SRP' | t }} </span>{% endif %}<span>{% if theme.show_currencies %}{{ shop.currency2.symbol }} {% endif %}{{ product.price.price_old | money_without_currency | replace({',00':',-'}) }}</span></div>{% endif %}

     <div class="for">

      {% if theme.show_currencies %}{{ shop.currency2.symbol }} {% endif %}

      

{% start custom code %}

      {% if product.price.price == '$987,654.00' %}

      {{ 'POA' }}

      {% else %}

      {{ product.price.price | money_without_currency | replace({',00':',-'}) }}

      {% endif %}

{% end custom code %}


       

      {% if shop.settings.legal.mode == 'strict' %}*{% endif %}

      {% if shop.b2b %}<span class="tax">{{ 'Excl. VAT' | t }}</span>{% endif %}

      {% if theme.show_stock_amount or theme.toon_voorraad or (theme.show_delivery_time and product.stock.delivery) %}

       {% if product.stock.available %}

        <div class="hurry"><i class="icon-check-white"></i> {% if theme.show_stock_amount %}{{ product.stock.level }} {% endif %}{% if theme.toon_voorraad %} {{ 'In stock' | t }}{% endif %}{% if theme.toon_voorraad and product.stock.delivery and theme.show_delivery_time %}: {% endif %}{% if product.stock.delivery and theme.show_delivery_time %}{{ product.stock.delivery.title | raw }}{% endif %}</div>

       {% else %}

        <div class="hurry too-late"><i class="icon-negative"></i> {% if theme.toon_voorraad %}{{ 'Out of stock' | t }}{% endif %}{% if theme.toon_voorraad and product.stock.delivery and theme.show_delivery_time %}: {% endif %}{% if product.stock.delivery and theme.show_delivery_time %}{{ product.stock.delivery.title | raw }}{% endif %}</div>

       {% endif %}

      {% endif %}

     </div>



Does anyone out there have some insight on how to replace the price with some text? 

Am I missing something in the syntax?


This is what I am trying to achieve: 

Thanks so much guys,


Trent

1 comment

  • GeannyGeanny Moderator, Lightspeed Staff Posts: 113 moderator

    Hi @Trent ,

    Here is a guide that goes over how to do this. However, the steps do not work with every theme.

    I believe it will point you in the right direction as most themes are structured the same way and use both product.rain and products.rain.

    You may still need to adjust the code or hire a developer to help you tweak it.

    This is an advanced procedure, not supported by Lightspeed and provided as-is. We recommend contacting a Lightspeed partner or third-party developer if you are not sure how to continue. Before enabling the theme editor, be aware of the consequences!


    Geanny

Sign In or Register to comment.