[JavaScript / jQuery] [Ecommerce] Need help with finding the issues in my code

Hi guys, hope you are doing well!

Does anyone see the issue with this code?
What I’m trying to do is, to build my own ‘Free Shipping Progress Bar’ for my ecommerce template. I used ID’s ONLY, because of the conversion to Shopify via Udesly later on.

I got some part of the code from this community post:

Current Code:

<script>
// create a variable with the name 'target', and get the .cart-body-section's content id: 'cart-body-section'
var target = document.getElementById('cart-body-section');
// create a variable with the name 'shippingThreshold', and set the shipping threshold to 40
var shippingThreshold = 40;
// create an observer instance with the variable name 'observer2'
var observer2 = new MutationObserver(function (mutations) {
    mutations.forEach(function (mutation) {
		// set delay timeout function, due to delay of cart update
        setTimeout(function(){
        // create a variable with the name 'subTotal', take the .cart-subtotal's text value, and replace
        var subTotal = $('cart-subtotal').text().replace(/[^\d.]/g, '');
        // create a variable with the name 'shippingDifference', which equals 'subTotal' variable minus (-) 'shippingThreshold' variable...
        var shippingDifference = subTotal - shippingThreshold;
            }
        // ...get the display text block id, and replace the text with the updated value from the created variable 'shippingDifference'
        $('cart-shipping-difference').text(shippingDifference);
        // create a variable with the name 'progressBar' which equals 'subTotal' variable, divided (/) by 'shippingThreshold' variable, times (*) 100
        var progressBar = subTotal / shippingThreshold * 100;
        // take the width of the object with the id: 'cart-shipping-meter-fill', and apply the 'progressBar' variable, plus (+) '%'
        $('cart-shipping-meter-fill').css('width', progressBar + '%');
    }, 300);
    });
});
// configuration for the observer variable:
var config = {
    attributes: false,
    childList: true,
    characterData: false
};
// pass in the target node, as well as the observer options
observer2.observe(target, config);
</script>

Here is my site Read-Only: https://preview.webflow.com/preview/sev-ecommerce-template?utm_medium=preview_link&utm_source=dashboard&utm_content=sev-ecommerce-template&preview=8495844538bc7139e2182fc435cf9df2&workflow=preview