Shopify themes, liquid, logos, and UX
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.
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
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
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:
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
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.
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
Thank you! Okay I'll try it and let you know if it works for me.
I pasted before the body tag and it still shows $0.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024