So here is some JavaScript that will add the info to the page.
You will need to modify your theme shopping cart .sst template file, and in the [-- DEFINE ShoppingCart --] section, look for this line:
- Code: Select all
[-- SC_JAVASCRIPT extras --]
And add this include line right after it:
- Code: Select all
[-- INCLUDE myCustom.js --]
Then look for these lines:
- Code: Select all
<body
[-- IF STORE.SC_BackgroundImage --]
background="[-- STORE.SC_BackgroundImage --]"
[-- END_IF --]
And modify it like this with an onLoad:
- Code: Select all
<body onLoad="myOnLoad();"
[-- IF STORE.SC_BackgroundImage --]
background="[-- STORE.SC_BackgroundImage --]"
[-- END_IF --]
Now here is the myCustom.js file that you need to include:
- Code: Select all
function myOnLoad () {
////////Add delivery time/days to Shipping Options
var _allnames = document.getElementsByName('shipping'); //Find everything with the name shipping
var _len = _allnames.length; //How many items are there?
if (_len >= 1) { //Make sure there is at least 1 item
for (_j=0; _j<_len; _j++) { //Loop thru each item
var _nodetype = _allnames[_j].nodeType; //Get the node type
var _name = 0;
if (_allnames[_j].attributes.getNamedItem('name')) {
_name = _allnames[_j].attributes.getNamedItem('name').value;
}
var _type = 0;
if (_allnames[_j].attributes.getNamedItem('type')) {
_type = _allnames[_j].attributes.getNamedItem('type').value;
}
if (_nodetype == 1) {
if ( (_name == 'shipping') && (_type == 'radio') ) { //Look for these specific things to get the correct node (INPUT tag in this case)
var _text_node = _allnames[_j]; //This is the node we were looking for
var _old_text = _text_node.nextSibling.nodeValue; //Get the text from the node beside it
if (_old_text.substr(0,14) == ' Media Mail® (' ) { //Ends with a ( so it's US only
_new_text = _old_text +' 2-8 business days';
} else if (_old_text.substr(0,15) == ' Parcel Post® (' ) { //Ends with a ( so it's US only
_new_text = _old_text +' 2-8 business days';
} else if (_old_text.substr(0,17) == ' Priority Mail® (' ) { //Ends with a ( so it's US only
_new_text = _old_text +' 1-3 business days';
} else if (_old_text.substr(0,16) == ' Express Mail® (' ) { //Ends with a ( so it's US only
_new_text = _old_text +' 1-2 business days';
} else if (_old_text.substr(0,20) == ' First Class Mail® I' ) { //Ends with an I so it's International
_new_text = _old_text +' Delivery times vary';
} else if (_old_text.substr(0,17) == ' Priority Mail® I' ) { //Ends with an I so it's International
_new_text = _old_text +' 6-10 business days';
} else if (_old_text.substr(0,16) == ' Express Mail® I' ) { //Ends with an I so it's International
_new_text = _old_text +' 3-5 business days';
} else if (_old_text.substr(0,27) == ' Global Express Guaranteed®' ) { //Global Express is always International
_new_text = _old_text +' 1-3 business days';
} else {
_new_text = _old_text;
}
_text_node.nextSibling.nodeValue = _new_text;
}
}
}
}
//////// END Add delivery time/days to Shipping Options
} // end myOnLoad