I have implemented the code below from the AUG and it works fine except it uses the Total Cart value (getCartItem(1)) whereas the Sub Total is more useful as it excludes vat and the shipping charge.
I have checked the actinicextras.js file and there appears to be only 2 values for getCartItem
1 = TOTAL_VALUE, 3 = CART_COUNT so I'm assuming a value for Sub Total needs to be added unless I've missed something. Any help would be appreciated.
<script language="javascript" type="text/javascript">
function de(prc) {
var data, endata;
data = new String(prc);
data = data.split(" ");
endata = cut(data[0]);
return endata;
}
function cut(dpt) {
stng = dpt.replace("£","");
stang = stng.replace(".",".");
stang = stang.replace(",","");
return stang; }
var left;
price = de(getCartItem(1));
if (price >= 100) {
document.write("You have qualified for free shipping!");
}
else {
left = (100 - price).toFixed(2);
document.write("You need to spend £"+left+" to obtain free shipping!");
}
</script>
I have checked the actinicextras.js file and there appears to be only 2 values for getCartItem
1 = TOTAL_VALUE, 3 = CART_COUNT so I'm assuming a value for Sub Total needs to be added unless I've missed something. Any help would be appreciated.
<script language="javascript" type="text/javascript">
function de(prc) {
var data, endata;
data = new String(prc);
data = data.split(" ");
endata = cut(data[0]);
return endata;
}
function cut(dpt) {
stng = dpt.replace("£","");
stang = stng.replace(".",".");
stang = stang.replace(",","");
return stang; }
var left;
price = de(getCartItem(1));
if (price >= 100) {
document.write("You have qualified for free shipping!");
}
else {
left = (100 - price).toFixed(2);
document.write("You need to spend £"+left+" to obtain free shipping!");
}
</script>
Comment