Personalized checkout and custom promotions with Shopify Scripts
Is it possible to get code on the cart sidebar to display text that changes when you total amount in the cart reaches a certain threshold. I have looked through the code, but I don't know where it would go.
This is the code here
<!DOCTYPE html>
<html>
<body>
<h1> TEST for Pop-up Main code</h1>
<h2> test for free shipping</h2>
<p id="demo"></p>
<script>
const hour = 52.50;
const priceo = 35-hour
var price=parseFloat(priceo).toFixed(2); // Makes the number to 2d.p.
let greeting;
if (hour >= 35) {
greeting = "Congratulations, you qualify for free UK shipping!"
document.getElementById("demo").style.color = "red";
} else {
greeting = "To qualify for free UK shipping, spend an extra £" + price;
}
if (hour >= 35) {
document.getElementById("demo").style.color = "lime";
} else {
document.getElementById("demo").style.color = "red";
}
document.getElementById("demo").innerHTML = greeting;
document.getElementById("demo").style.fontSize = "10px";
document.getElementById("demo").style.fontFamily = "Arial"
</script>
</body>
</html>
"const hour" is the total price in the cart
I would like to just place it below the subtotal
Thanks
Hi @SBurt1 ,
Its a time consuming customization work.
Connect me on via email or Skype.
User | RANK |
---|---|
4 | |
2 | |
2 | |
2 | |
2 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023