How to replace price with custom text for specific products, on product page and collection page

How to replace price with custom text for specific products, on product page and collection page

aaamodelsupply
New Member
5 0 0

I am wanting to replace an items price with custom text "Price in Cart" . I have accomplished this on the main product page with some code editing in the main-product.liquid. with the following code:

 

{%- when 'price' -%}
<div class="no-js-hidden" id="price-{{ section.id }}" role="status" {{ block.shopify_attributes }}>
{%- assign specific_product_handle = "jaco-1-12-magenta-front-world-championship-edition" %}
{%- assign specific_product_id = 8370366153016 %}

{% if product.handle == specific_product_handle or product.id == specific_product_id %}

<p>Price in Cart</p>
{% else %}
{%- render 'price',
product: product,
use_variant: true,
show_badges: true,
price_class: 'price--large' %}
{% endif %}

 

But I cannot seem to find the right place to make this work on the collections page. 

Reply 1 (1)

PaulNewton
Shopify Partner
7722 678 1627

Hi @aaamodelsupply 👋 this varies by theme not everyone has the same setup you do.

So you just have to dig around sections/main-collection , sections-product-grid, or snippets card-product ,etc.

 

Or shift any logic to be inside the relevant price snippets.

 

 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org