Shopify themes, liquid, logos, and UX
In my store price discount shows as you can see I want this will show with word SAVE like SAVE $20.00 how I ca do that my them is dawn in that price is not customize able .
Thanks
Hi @Alexa71 ,
We do need to add a custom code that will calculate the discount percentage and show it in place of compare price.
Thanks
Hi @Alexa71 ,
Follow these Steps:
1) Go to Online Store
2) Edit Code
3) Find theme.liquid file
4) Add the following code just above tag </body>
<script>
setTimeout(function name(params) {
try {
let savingElement = document.querySelector('.sls-savings-badge span.money.conversion-bear-money');
let badgeElement = document.querySelector('span.badge.price__badge-sale');
if (savingElement && badgeElement) {
let saving = savingElement.innerHTML;
badgeElement.innerHTML = "Save " + saving;
} else {
console.log("One or both of the elements were not found.");
}
} catch (error) {
console.log("An error occurred:", error);
}
}, 3000);
</script>
Please don't hesitate to reach out if you need further help optimizing or customizing your store. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
LuffyOnePiece
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By 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, 2024