Adding custom code on cart sidebar to display messages

1 0 0

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>

<h1> TEST for Pop-up Main code</h1>

<h2> test for free shipping</h2>

<p id="demo"></p>


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"




"const hour" is the total price in the cart

I would like to just place it below the subtotal



Reply 1 (1)

Shopify Partner
15897 2378 3084

Hi @SBurt1 ,

Its a time consuming customization work.

Connect me on via email or Skype.

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free