Making a $0 product to show no price on Empire theme

Making a $0 product to show no price on Empire theme

theoilbar
Tourist
5 0 1

Hello!

 

We have fragrances that we want to list as  individual products. We set them to $0 until the customer chooses the format they want it in (scrub, body wash, shea butter). Then the price gets tacked on. 

 

Is there a way to remove the initial $0 price tag altogether or replace it with text like "Choose a product" ?

 

I have seen similar posts but those solutions don't work on the Empire theme. 

 

 

Replies 7 (7)

BSSCommerce-HDL
Shopify Partner
2071 734 921

Hi @theoilbar 

Can you provide store URL ( with password if needed) then we can firgure out if it possible?

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

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
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

theoilbar
Tourist
5 0 1

Yeah the url is https://www.theoilbar.com

 

and this is the collection I want to edit : https://www.theoilbar.com/collections/new-fragrances-1

BSSCommerce-HDL
Shopify Partner
2071 734 921

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

Step 2: Search file theme.liquid

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

 

<script>  
const e = document.querySelectorAll(".money");
    for (const item of e) {
        if (item.innerText.includes('$0.00')) {
            item.innerText = 'Choose a product';
        }
    } 
</script>

 

 Here is result:

BSSCommerceHDL_0-1724261337744.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 😍

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

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
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

theoilbar
Tourist
5 0 1

Thank you for your reply!

 

The only body tag i see is this one:

 

<body class="template-{{ template.name }}" data-instant-allow-query-string {% if settings.reduce_animations %}data-reduce-animations{% endif %}>
<script>

 

And when I pasted it above that it didn't make any change.

Guleria
Shopify Partner
3396 676 957

Hello @theoilbar ,

 

Edit theme.liquid search for </body> 
Not just before to it  add this code

<script>
// Select all elements with the class 'money'
const moneyElements = document.querySelectorAll('.money');

// Loop through all the elements
moneyElements.forEach(function(element) {
    // Check if the text content is '$0.00'
    if (element.textContent.trim() === '$0.00') {
        // Replace it with 'Choose a product'
        element.textContent = 'Choose a product';
    }
});

</script>

 

Thanks

- If helpful then please Like and Accept Solution.
- Drop an email   if you are looking for quick fix or any customization ( paid services )
- Email: guleriathakur43@gmail.com
- Try GEMPAGES a great page builder
theoilbar
Tourist
5 0 1

Thank you! Okay I'll try it  and let you know if it works for me. 

theoilbar
Tourist
5 0 1

I pasted before the body tag and it still shows $0.